Hi, experimenting with type conversions I'm having some trouble.
In assignment context narrowing primitive followed by boxing conversion should be allowed according to JLS (fi is a constant expression at compile time of type int, variable B is of type Byte and 0 is representable in the type byte), instead I get an error at runtime.
$ javac AssignmentTest.java
$ java AssignmentTest ### java version: "1.5.0_15"
Exception in thread "main" java.lang.VerifyError: (class: AssignmentTest, method: main signature: ([Ljava/lang/String;)V) Accessing value from uninitialized register 3
Would you please explain what's going on?
Thanks
P.S.
Btw, JLS also says that "the only exceptions that an assignment conversion may cause are OutOfMemoryError, ClassCastException and NullPointerException", VerifyError is not even mentioned.