Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
4.0.13
-
None
-
None
Description
With static compilation, when iterating a collection of Tuple2s, the Tuple2's type parameters are lost.
This example fails to compile:
import groovy.transform.CompileStatic @CompileStatic // compiles successfully without this class Tuple2Parameters { List<Tuple2<String, String>> myList = [] void myMethod() { myList.each { String first, String second -> // [Static type checking] - Expected type java.lang.Object for closure parameters true } } }
Attachments
Issue Links
- is related to
-
GROOVY-11089 STC: closure param type inference for array and list
- Closed
-
GROOVY-11090 STC: closure param type inference for tuple
- Closed
- relates to
-
GROOVY-11135 Unable to compile: Expected type java.lang.Object for closure parameter
- Closed
-
GROOVY-11125 withIndex().collect loses type parameters
- Closed