[ 
https://issues.apache.org/jira/browse/GROOVY-7610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cédric Champeau updated GROOVY-7610:
------------------------------------
    Fix Version/s:     (was: 2.4.5)
                   2.4.6

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

Reply via email to