Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.7, 2.4.0-beta-3
-
None
Description
I can compile this if I change Iterable to Collection.
import groovy.transform.CompileStatic @CompileStatic class Test { static void test(Iterable<Integer> list) { for (Integer obj : list) {} } } Test.test([0])
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Test.groovy: 6: [Static type checking] - Cannot loop with element of type java.lang.Integer with collection of type java.lang.Iterable <Integer> @ line 6, column 9. for (Integer obj : list) {} ^ 1 error