Closed
Description
class Foo[U] { self : Array[U] & Nothing =>
val s = self(0)
}
Exception in thread "main" scala.MatchError: TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),class Foo) (of class dotty.tools.dotc.core.Types$CachedTypeRef)
at dotty.tools.dotc.typer.TypeAssigner.arrayElemType$1(TypeAssigner.scala:274)
at dotty.tools.dotc.typer.TypeAssigner.assignType(TypeAssigner.scala:279)
at dotty.tools.dotc.typer.TypeAssigner.assignType$(TypeAssigner.scala:271)
at dotty.tools.dotc.typer.Typer.assignType(Typer.scala:83)
at dotty.tools.dotc.transform.Erasure$Typer.selectArrayMember$1(Erasure.scala:408)
at dotty.tools.dotc.transform.Erasure$Typer.recur$1(Erasure.scala:430)
at dotty.tools.dotc.transform.Erasure$Typer.typedSelect(Erasure.scala:440)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1758)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1828)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:113)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1860)
at dotty.tools.dotc.reporting.trace$.op1$3(trace.scala:32)
at dotty.tools.dotc.reporting.trace$.apply(trace.scala:33)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1856)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1868)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1928)
at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:488)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1777)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1829)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:113)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1860)
at dotty.tools.dotc.reporting.trace$.op1$3(trace.scala:32)
at dotty.tools.dotc.reporting.trace$.apply(trace.scala:33)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1856)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1868)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1928)
at dotty.tools.dotc.typer.Typer.$anonfun$typedDefDef$1(Typer.scala:1428)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1410)
at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:571)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1765)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1828)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:113)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1860)
at dotty.tools.dotc.reporting.trace$.op1$3(trace.scala:32)
at dotty.tools.dotc.reporting.trace$.apply(trace.scala:33)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1856)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1868)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1887)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1916)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:678)
at dotty.tools.dotc.typer.Typer.$anonfun$typedClassDef$1(Typer.scala:1529)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1455)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1768)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1828)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:113)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1860)
at dotty.tools.dotc.reporting.trace$.op1$3(trace.scala:32)
at dotty.tools.dotc.reporting.trace$.apply(trace.scala:33)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1856)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1868)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1887)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1916)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:678)
at dotty.tools.dotc.typer.Typer.$anonfun$typedPackageDef$1(Typer.scala:1636)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1627)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1808)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1829)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:113)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1860)
at dotty.tools.dotc.reporting.trace$.op1$3(trace.scala:32)
at dotty.tools.dotc.reporting.trace$.apply(trace.scala:33)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1856)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1868)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1928)
at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:99)
at dotty.tools.dotc.core.Phases$Phase.$anonfun$runOn$1(Phases.scala:292)
at scala.collection.immutable.List.map(List.scala:283)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:290)
at dotty.tools.dotc.core.Phases$Phase.runOn$(Phases.scala:289)
at dotty.tools.dotc.transform.Erasure.runOn(Erasure.scala:34)
at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:174)