Community
Participate
Working Groups
I20041216 (M4) The following snippet compiled, but failed when run with a VerifyError ("failed to pop argument off empty stack" or so): catch (Exception e) { System.out.println(e.printStackTrace()); }
Could you please provide full test case and compiler options used? Thanks.
I've bumped into the same thing (3.1M4, Linux). Test case: public class Test { public static void main(String[] args) { doFoo(getVoid()); } private static void doFoo(Object o) { } private static void getVoid() { } } Eclipse will compile it, but gives the following error when running it: Exception in thread "main" java.lang.VerifyError: (class: Test, method: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empty stack Trying the same thing with javac: > /opt/jdk1.5.0_01/bin/javac Test.java Test.java:3: 'void' type not allowed here doFoo(getVoid()); ^ 1 error Eclipse has Compiler compliance level = 5.0, but other than that only default compiler options are used for both eclipse and javac. With Compiler compliance level = 1.4 eclipse gives the expected error message: "The method doFoo(Object) in the type Test is not applicable for the arguments (void)"
Definitely not good. Likely a consequence of changes near autoboxing support.
It appears we are incorrectly boxing 'void' into 'Object' (and of course it doesn't verify properly since impossible conversion).
Removed erroneous rules for 'void' and 'Void'. Fixed Added regression test: AutoboxingTest#test072
*** Bug 83478 has been marked as a duplicate of this bug. ***
Verified in I20050214
*** Bug 85870 has been marked as a duplicate of this bug. ***