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

[jira] [Resolved] (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:all-tabpanel ]

Cédric Champeau resolved GROOVY-7610.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.5

> 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
>             Fix For: 2.4.5
>
>
> 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)