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

Cannot create AIC inside closure body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.2
    • 2.4.0-rc-1
    • Static compilation
    • None

    Description

      @groovy.transform.CompileStatic
      class Container {
        static void main(String... args) {
          [].each {
            new Object() {}
          }
        }
      }
      

      Yields:

      [Static type checking] - Cannot call Container$1#<init>(groovy.lang.Closure) with arguments [Container] 
       at line: 7, column: 11
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ldaley Luke Daley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: