Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7315

CompileStatic/TypeChecked cannot create non-static nested inner class using named-arg short-hand syntax

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.9, 2.4.1
    • 2.4.13
    • Static Type Checker
    • None

    Description

      @groovy.transform.CompileStatic
      class X {
        Y makeY() {
          new Y(a:1)
        }
        
        private class Y {
          int a
        }
      }
      
      println new X().makeY()
      

      Error:

      [Static type checking] - Cannot find matching method X$Y#<init>(X, java.util.LinkedHashMap <java.lang.String, java.lang.Integer>). Please check if the declared type is right and if the method exists.
      

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              gillius Jason Winnebeck
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: