Closed
Description
The following code:
class Cont[A0](x0: A0) { type A = A0; val x: A = x0 }
val c: { type A; val x: A } & { type A = Int } = new Cont(1)
c.x : Int
... makes the compiler crash with:
Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
at dotty.tools.dotc.core.SymDenotations$NoDenotation.owner(SymDenotations.scala:1816)
at dotty.tools.dotc.transform.Erasure$Typer.mapOwner$1(Erasure.scala:360)
at dotty.tools.dotc.transform.Erasure$Typer.typedSelect(Erasure.scala:364)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1606)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1671)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:94)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1687)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1685)
at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:140)
at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1685)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1720)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1732)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:608)
at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:1398)
at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:1328)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1328)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1616)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1671)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:94)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1687)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1685)
at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:140)
at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1685)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1709)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1732)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:608)
at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1515)
at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1502)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1502)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1655)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1672)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:94)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1687)
at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1685)
at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:140)
at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1685)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1744)
at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:95)
at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:283)
at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:281)
at scala.collection.immutable.List.map(List.scala:284)
at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:281)
at dotty.tools.dotc.transform.Erasure.runOn(Erasure.scala:33)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:82)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:79)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply$mcV$sp(Run.scala:79)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:67)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:67)
at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:76)
at dotty.tools.dotc.Run.compileUnits(Run.scala:67)
at dotty.tools.dotc.Run.compileSources(Run.scala:64)
at dotty.tools.dotc.Run.compile(Run.scala:48)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
at dotty.tools.dotc.Driver.process(Driver.scala:124)
at dotty.tools.dotc.Driver.process(Driver.scala:93)
at dotty.tools.dotc.Driver.process(Driver.scala:105)
at dotty.tools.dotc.Driver.main(Driver.scala:132)
at dotty.tools.dotc.Main.main(Main.scala)