You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Shil Sinha (JIRA)" <ji...@apache.org> on 2015/10/07 06:20:26 UTC

[jira] [Created] (GROOVY-7618) Parameterless closure to SAM coercion causes NPE during instruction selection with STC

Shil Sinha created GROOVY-7618:
----------------------------------

             Summary: Parameterless closure to SAM coercion causes NPE during instruction selection with STC
                 Key: GROOVY-7618
                 URL: https://issues.apache.org/jira/browse/GROOVY-7618
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 2.4.5
         Environment: Java 1.8.0_60, OSX 10.10
            Reporter: Shil Sinha
            Assignee: Cédric Champeau


Coercion of parameterless closures (lazy eval blocks) to SAM type arguments  results in an NPE during static type checking.

Example:

{code}
interface SamType {
    int sam()
}

int foo(SamType samt) {
    samt.sam()
}

@groovy.transform.TypeChecked
void doFoo() {
    assert foo { -> 1 } == 1
}

doFoo()
{code}

Results in:
{code}
BUG! exception in phase 'instruction selection' in source unit 'ConsoleScript19' unexpected NullpointerException
Caused by: java.lang.NullPointerException
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)