Skip to content

Type uninitializedThis is not assignable #2163

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
felixmulder opened this issue Mar 31, 2017 · 6 comments · Fixed by #2216
Closed

Type uninitializedThis is not assignable #2163

felixmulder opened this issue Mar 31, 2017 · 6 comments · Fixed by #2216
Assignees

Comments

@felixmulder
Copy link
Contributor

In b1801a4f. The backend explodes with:

[error] Test dotty.tools.dotc.transform.PatmatExhaustivityTest.patmatExhaustivity failed: java.lang.VerifyError: Bad type on operand stack
[error] Exception Details:
[error]   Location:
[error]     dotty/tools/dotc/reporting/TestReporter$$anon$18.<init>(Ljava/io/PrintWriter;)V @7: invokedynamic
[error]   Reason:
[error]     Type uninitializedThis (current frame, stack[1]) is not assignable to 'dotty/tools/dotc/reporting/TestReporter$$anon$18'
[error]   Current Frame:
[error]     bci: @7
[error]     flags: { flagThisUninit }
[error]     locals: { uninitializedThis, 'java/io/PrintWriter' }
[error]     stack: { uninitializedThis, uninitializedThis }
[error]   Bytecode:
[error]     0x0000000: 2a2b b500 122a 2aba 0025 0000 b200 29ba
[error]     0x0000010: 0035 0000 04b7 0038 b1                 
[error] , took 0.01 sec
[error]     at dotty.tools.dotc.reporting.TestReporter$.simplifiedReporter(TestReporter.scala:126)
[error]     at dotty.tools.dotc.transform.PatmatExhaustivityTest.compileFile(PatmatExhaustivityTest.scala:20)
[error]     at dotty.tools.dotc.transform.PatmatExhaustivityTest.$anonfun$176(PatmatExhaustivityTest.scala:74)
[error]     at scala.collection.immutable.List.map(List.scala:273)
[error]     at dotty.tools.dotc.transform.PatmatExhaustivityTest.patmatExhaustivity(PatmatExhaustivityTest.scala:75)
[error]     ...
@DarkDimius
Copy link
Contributor

@felixmulder, could you please try to minimize?

@felixmulder
Copy link
Contributor Author

No, I really don't want to 😢

But I'll do it, for you...maybe on Monday 😂

@DarkDimius
Copy link
Contributor

Does it happen on the bootstrapped version or during the bootstrap itself?
Was it fine before dotty-staging@058771a ?

@felixmulder
Copy link
Contributor Author

@liufengyun liufengyun self-assigned this Apr 5, 2017
@DarkDimius
Copy link
Contributor

The bug has nothing to do with backend. Lamda lift is to blame.
It Moved a lambda defined in a super-call into a private method in the class containing this supercall.
This makes method inaccessible in supercall.

@liufengyun
Copy link
Contributor

Minimal code to reproduce the problem:

class Base(f: Int => Int) {
  f(3)
}

class Child(x: Int) extends Base(y => x + y)

object Test {
  def main(args: Array[String]): Unit = new Child(4)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants