Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.6
-
None
-
None
-
jdk1.6_12, Vista
Groovy 1.6 console and Grails 1.1
Description
// generates error class Foo { long id // or float or double boolean bar() { return (id ? true : false) } } Foo foo = new Foo()
Running the above will result in the following exception:
java.lang.VerifyError: (class: Foo, method: bar signature: ()Z) Expecting to find integer on stack
Declaring id as a float or double will also generate this error; however, if Foo.id is any other type (primitive or otherwise) then the script runs properly. Similarly, explicitly casting Foo.id inside Foo.bar() does not generate this error:
// no VerifyError class Foo { long id boolean bar() { return (long)id ? true : false } } // no VerifyError class Foo { int id // or boolean or char or Long, etc. boolean bar() { return id ? true : false } }