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

CompileStatic broken for transpose lists in 4.0.14 but works in 4.0.13

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 4.0.14, 4.0.15
    • None
    • None
    • None

    Description

      the following code when entered into groovyConsole works on 4.0.13 but breaks on 4.0.14/4.0.15

      import groovy.transform.*
      
      @CompileStatic
      static foo() {
          def l = [37, 34, 12, 412, 5]
          [l, [0] + l].transpose().each { int i, int j ->
              println "foo $i $j"
          }
      }
      foo() 

      The error is

      1 compilation error:Incorrect number of parameters. Expected 1 but found 2
       at line: 6, column: 35

      The correct output should be

      foo 37 0
      foo 34 37
      foo 12 34
      foo 412 12
      foo 5 412
      

       

       

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              aibolit Aleks Tamarkin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: