Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.4, 2.4.5
-
None
-
OS X 10.10, JDK 1.8.0_60
Description
Here's an example:
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()
The above code throws the following error:
java.lang.VerifyError: (class: A, method: ternaryCondition signature (Ljava/lang/Object;Ljava/lang/Object;)V) Expecting to find object/array on stack
This appears to be caused by the ?.is call expression being transformed to a CompareIdentityExpression, which is semantically different.