Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.6
-
None
Description
The two attached files (bad.groovy & good.groovy) demonstrate the problem. In bad.groovy, a class with the @CompileStatic annotation attempts to collect the objects from a Set<> using the spread operator and fails with the compilation error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
bad.groovy: 17: [Static type checking] - No such property: strings for class: java.util.Set <Inner>
@ line 17, column 13.
println outer.inners*.strings
^
1 error
In good.groovy, the equivalent .collect{} is used for the spread operator and it compiles and runs as expected.