Skip to content

Class declaration and -Ystop-after:erasure throws NPE #9267

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
TheElectronWill opened this issue Jul 1, 2020 · 0 comments · Fixed by #9269
Closed

Class declaration and -Ystop-after:erasure throws NPE #9267

TheElectronWill opened this issue Jul 1, 2020 · 0 comments · Fixed by #9269

Comments

@TheElectronWill
Copy link
Contributor

Minimized code

class A

with -Ystop-after:erasure

Output (click arrow to expand)

exception while typing @scala.annotation.internal.SourceFile("../dotty-test/src/A.scala") class A()
   extends
 Object() {} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1044
exception while typing package <empty> {
  @scala.annotation.internal.SourceFile("../dotty-test/src/A.scala") class A()
     extends
   Object() {}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 1052
exception occurred while compiling ../dotty-test/src/A.scala
java.lang.NullPointerException while compiling ../dotty-test/src/A.scala
Exception in thread "main" java.lang.NullPointerException
	at dotty.tools.dotc.core.Phases$Phase.next(Phases.scala:413)
	at dotty.tools.dotc.transform.Bridges.<init>(Bridges.scala:19)
	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:945)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2055)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2385)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2389)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2456)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:124)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2523)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2532)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2535)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2557)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2602)
	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:947)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2181)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2429)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2457)
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 1, 2020
  * Only compute `elimErasedCtx` when error is emitted
  * Fall back to erasure context if it is the last phase
@nicolasstucki nicolasstucki linked a pull request Jul 1, 2020 that will close this issue
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 1, 2020
  * Only compute `elimErasedCtx` when error is emitted
  * Fall back to erasure context if it is the last phase
nicolasstucki added a commit that referenced this issue Jul 1, 2020
Fix #9267: Avoid accessing inexistent next phase
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.

1 participant