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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.9, 2.4.1
    • Fix Version/s: 2.4.13
    • Component/s: Static Type Checker
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: