Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
@groovy.transform.TypeChecked void test(int[] ints) { ints.eachWithIndex { value, index -> println "$index: ${value.doubleValue()}" } } test(0,1,2,3,4,5)
Compiler reports "[Static type checking] - Cannot find matching method java.lang.Object#doubleValue()"
eachWithIndex is only provided for reference types, so "value" is seen as Object by the type checker.
Attachments
Issue Links
- is a clone of
-
GROOVY-10682 Provide eachWithIndex for primitive arrays
- Closed
- links to