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

each after transpose with 2 arguments does not compile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.19
    • 5.0.0-alpha-1
    • None

    Description

      Hi there, this code compiled up until groovy 3.0.18, in 3.0.19 stopped compiling:

      @groovy.transform.CompileStatic
      class Prueba {
          public static void main(String[] args) {
              [
                  [1],
                  ['a'],
              ].transpose().each { int a, String b ->
                  println(a)
                  println(b)
              }
          }
      }
       

       

      $ groovy Prueba.groovy 
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      /home/becho/Prueba.groovy: 9: Incorrect number of parameters. Expected 1 but found 2
       @ line 9, column 22.
                 ].transpose().each { int a, String b ->
                              ^1 error
       

       

      Is this an expected behavior? Or something got broken along the way?

       

       

       

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              maurociancio Mauro Ciancio
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: