Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Follow up to GROOVY-9790. If a lambda expression does not reference one of its parameters, no inferred type metadata is written to the parameter and the boostrap error can still occur.
Consider the following:
@groovy.transform.CompileStatic void test1() { java.util.stream.IntStream.range(0, 2).forEach( (Integer i) -> { } // no reference to "i" ) } @groovy.transform.CompileStatic void test2() { java.util.stream.IntStream.range(0, 2).forEach( (String s) -> { assert false } // no reference to "s" ) }
9790 fixes depend of the inferred type of a variable expression being written back to accessed variable (the parameter).
Attachments
Issue Links
- relates to
-
GROOVY-10372 STC: check lambda or closure parameter types against target method
- Closed