Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
import java.util.function.Consumer import static groovy.lang.Tuple.tuple @groovy.transform.TypeChecked test() { Consumer<Tuple3<String,Number,?>> c = { x, y, z -> print y } c.accept(tuple("",(Number)42,null)) } test()
STC error: "Wrong number of parameters for method target accept(groovy.lang.Tuple3<java.lang.String, java.lang.Number, ?>)"
This kind of list/tuple destructuring is supported by the dynamic runtime (see ClosureMetaClass).
Attachments
Issue Links
- is related to
-
GROOVY-8499 Glitch with native lambda support when supplied with incorrect arity lambda
- Closed
-
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-11188 CompileStatic broken for transpose lists in 4.0.14 but works in 4.0.13
- Closed
-
GROOVY-11185 each after transpose with 2 arguments does not compile
- Closed