[ 
https://issues.apache.org/jira/browse/GROOVY-11188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17773672#comment-17773672
 ] 

Aleks Tamarkin commented on GROOVY-11188:
-----------------------------------------

[~paulk] I noticed that transpose for *Array* returns an *Array[][]* 
[https://github.com/apache/groovy/blob/e2ff7dbe3f82c9f8fbdd7186184f8530fb6b55b2/src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java#L8541]

But transpose for *List* takes and return a flat *List*
[https://github.com/apache/groovy/blob/e2ff7dbe3f82c9f8fbdd7186184f8530fb6b55b2/src/main/java/groovy/util/GroovyCollections.java#L165]

Should transpose for *List* take and return a *List<List>*

> CompileStatic broken for transpose lists in 4.0.14 but works in 4.0.13
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-11188
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11188
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.14, 4.0.15
>            Reporter: Aleks Tamarkin
>            Assignee: Eric Milles
>            Priority: Major
>
> the following code when entered into groovyConsole works on 4.0.13 but breaks 
> on 4.0.14/4.0.15
> {code:java}
> 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() {code}
> The error is
> {code:java}
> 1 compilation error:Incorrect number of parameters. Expected 1 but found 2
>  at line: 6, column: 35{code}
> The correct output should be
> {code:java}
> foo 37 0
> foo 34 37
> foo 12 34
> foo 412 12
> foo 5 412
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to