Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.5
-
None
-
Java 1.8.0_60, OSX 10.10
Description
Coercion of parameterless closures (lazy eval blocks) to SAM type arguments results in an NPE during static type checking.
Example:
interface SamType { int sam() } int foo(SamType samt) { samt.sam() } @groovy.transform.TypeChecked void doFoo() { assert foo { -> 1 } == 1 } doFoo()
Results in:
BUG! exception in phase 'instruction selection' in source unit 'ConsoleScript19' unexpected NullpointerException Caused by: java.lang.NullPointerException