Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.6
-
None
Description
Consider this Java class:
package test51; import java.util.List; public class Foo { public List<Object[]> bar() { return null; } }
and this Groovy class:
package test51 import groovy.transform.CompileStatic @CompileStatic class Test51 { protected void foo() { List<Object[]> foo = new Foo().bar() foo.each { row -> def o = row[0] } } List bar() { } }
This produces a compiler error because row is resolved as Object rather than Object[].
A workaround is to declare row as Object[] row in the closure parameter list.
Attachments
Issue Links
- links to