Skip to content

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

Closed
@TheElectronWill

Description

@TheElectronWill

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)

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