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/09/29 06:56:04 UTC

[jira] [Commented] (GROOVY-7610) Null safe is call throws VerifyError when used as condition with CompileStatic

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

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

GitHub user shils opened a pull request:

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

    GROOVY-7610 Null safe is calls throw VerifyError when used as conditi…

    …on with CompileStatic
    
    * Null safe .is method call expressions were being transformed to CompareIdentityExpressions

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

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

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

    https://github.com/apache/incubator-groovy/pull/123.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 #123
    
----
commit bb2a18b500183999bb3dd9cc57977272d93dc71c
Author: Shil S <sh...@gmail.com>
Date:   2015-09-29T04:53:21Z

    GROOVY-7610 Null safe is calls throw VerifyError when used as condition with CompileStatic
    * Null safe .is method call expressions were being transformed to CompareIdentityExpressions

----


> Null safe is call throws VerifyError when used as condition with CompileStatic
> ------------------------------------------------------------------------------
>
>                 Key: GROOVY-7610
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7610
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.4.4, 2.4.5
>         Environment: OS X 10.10, JDK 1.8.0_60
>            Reporter: Shil Sinha
>            Assignee: Cédric Champeau
>
> Here's an example:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class A {
>     void ifCondition(Object x, Object y) {
>         if (x?.is(y))
>             return
>     }
>     void ternaryCondition(Object x, Object y) {
>           x?.is(y) ? 'foo' : 'bar'
>     }
> }
> new A()
> {code}
> The above code throws the following error:
> {code}
> java.lang.VerifyError: (class: A, method: ternaryCondition signature (Ljava/lang/Object;Ljava/lang/Object;)V) Expecting to find object/array on stack
> {code}
> This appears to be caused by the ?.is call expression being transformed to a CompareIdentityExpression, which is semantically different.



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