[ 
https://issues.apache.org/jira/browse/GROOVY-7618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14947414#comment-14947414
 ] 

ASF GitHub Bot commented on GROOVY-7618:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-groovy/pull/135


> 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)

Reply via email to