Skip to content

VerifyError on super call, trait extends class #16698

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

Open
som-snytt opened this issue Jan 14, 2023 · 0 comments
Open

VerifyError on super call, trait extends class #16698

som-snytt opened this issue Jan 14, 2023 · 0 comments

Comments

@som-snytt
Copy link
Contributor

Compiler version

3.2.1

Minimized code

case class Ball(value: Int) {
  def number = value
  def isMagic = number == 8
}

trait Magicify extends Ball {
  override def number: Int = super[Ball].number + 1
}

object m extends Ball(1) with Magicify

@main def test() = println(m)

Output

Exception in thread "main" java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.

Expectation

2.13.10 says

restricted.scala:8: error: Implementation restriction: traits may not select fields or methods from super[C] where C is a class

same ballpark:
#9341
#1501

@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 14, 2023
@som-snytt som-snytt changed the title VerifyError on super call VerifyError on super call, trait extends class Jan 14, 2023
@Kordyjan Kordyjan added area:typer and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 16, 2023
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

2 participants