Closed
Description
object Test {
val a = 42
def main(args: Array[String]) = {
val a: Int = a
}
}
Fails at runtime with
java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
Test$.main([Ljava/lang/String;)V @0: iload_2
Reason:
Type top (current frame, locals[2]) is not assignable to integer
Current Frame:
bci: @0
flags: { }
locals: { 'Test$', '[Ljava/lang/String;' }
stack: { }
Bytecode:
0x0000000: 1c3d b1
We should not only detect the cyclic reference and check why was this illegal bytecode generated in the backend.