Skip to content

Runtime error: Bad invokespecial instruction related to super class #9341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liufengyun opened this issue Jul 10, 2020 · 0 comments
Closed

Comments

@liufengyun
Copy link
Contributor

liufengyun commented Jul 10, 2020

Minimized code

class T { def f: Int = 10 }
class B extends T {
  class C { B.super[T].f }
  new C
}

@main
def Test = new B

Output

Exception in thread "main" java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    B$C.<init>(LB;)V @22: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0x0000000: 2bc7 000b bb00 0e59 b700 11bf 2a2b b500
    0x0000010: 132a b700 142a b700 1a57 b1
  Stackmap Table:
    same_frame(@12)

	at B.<init>(super2.scala:4)
	at super2$package$.Test(super2.scala:8)
	at Test.main(super2.scala:7)

Expectation

Related bug: scala/bug#10290

@liufengyun liufengyun self-assigned this Jul 10, 2020
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jul 15, 2020
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jul 21, 2020
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jul 22, 2020
liufengyun added a commit to dotty-staging/dotty that referenced this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant