Skip to content

Missing cyclic reference on simple val. #2005

Closed
@nicolasstucki

Description

@nicolasstucki
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions