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

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

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

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

GitHub user shils opened a pull request:

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

    GROOVY-7618 Parameterless closure to SAM Type argument coercion cause…

    …s NPE during instruction selection (STC)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shils/incubator-groovy GROOVY-7618

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #135
    
----
commit ea3e8220668734aa009e276d41387f1b36c5641c
Author: Shil S <sh...@gmail.com>
Date:   2015-10-07T04:21:51Z

    GROOVY-7618 Parameterless closure to SAM Type argument coercion causes NPE during instruction selection (STC)

----


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