Closed
Description
Leftover from #4389 in bugs.txt
:
==> 24a880a744c4f045e6e4ad07cc4ffd6ca618aec1.scala <==
class x0 {
var x0 == _ *
or equivalently:
==> 2754249603605089a03422a9c0c4ead04d4ede2c.scala <==
class x0 {
var x1 == _ *
calls TypeName.asTermName
, which fails with throw new ClassCastException(...)
:
Exception in thread "main" java.lang.ClassCastException: _* is not a term name
at dotty.tools.dotc.core.Names$TypeName.asTermName(Names.scala:441)
at dotty.tools.dotc.core.Names$TypeName.asTermName(Names.scala:433)
at dotty.tools.dotc.ast.desugar$.derivedValDef(Desugar.scala:899)
at dotty.tools.dotc.ast.desugar$.$anonfun$makePatDef$5(Desugar.scala:756)
at scala.collection.TraversableLike$WithFilter.$anonfun$map$2(TraversableLike.scala:739)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:738)
at dotty.tools.dotc.ast.desugar$.makePatDef(Desugar.scala:753)
at dotty.tools.dotc.ast.desugar$.$anonfun$patDef$3(Desugar.scala:705)
at scala.collection.immutable.List.map(List.scala:283)
at dotty.tools.dotc.ast.desugar$.patDef(Desugar.scala:705)
at dotty.tools.dotc.ast.desugar$.defTree(Desugar.scala:774)
at dotty.tools.dotc.typer.Namer.expand(Namer.scala:419)
at dotty.tools.dotc.typer.Namer.$anonfun$index$18(Namer.scala:683)
at dotty.tools.dotc.typer.Namer.$anonfun$index$18$adapted(Namer.scala:683)
at scala.collection.immutable.List.foreach(List.scala:389)
at dotty.tools.dotc.typer.Namer.index(Namer.scala:683)
at dotty.tools.dotc.typer.Namer.indexAndAnnotate(Namer.scala:760)
at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:982)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:821)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:248)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeInfo$1(SymDenotations.scala:211)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:213)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:354)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:1727)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1752)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1824)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1856)
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:1852)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1864)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1883)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1912)
at dotty.tools.dotc.typer.Typer.$anonfun$typedPackageDef$1(Typer.scala:1631)
at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1624)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1804)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1825)
at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1856)
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:1852)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1864)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1924)
at dotty.tools.dotc.typer.FrontEnd.$anonfun$typeCheck$1(FrontEnd.scala:66)
at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:34)
at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:64)
at dotty.tools.dotc.typer.FrontEnd.$anonfun$runOn$7(FrontEnd.scala:95)
at dotty.tools.dotc.typer.FrontEnd.$anonfun$runOn$7$adapted(FrontEnd.scala:95)
at scala.collection.immutable.List.foreach(List.scala:389)
at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:95)
at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:174)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.trackTime(Stats.scala:47)
at dotty.tools.dotc.Run.$anonfun$compileUnits$2(Run.scala:171)
at dotty.tools.dotc.Run.$anonfun$compileUnits$2$adapted(Run.scala:169)
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32)
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:191)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:169)
at dotty.tools.dotc.Run.$anonfun$compileUnits$1(Run.scala:194)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:88)
at dotty.tools.dotc.Run.compileUnits(Run.scala:149)
at dotty.tools.dotc.Run.compileSources(Run.scala:136)
at dotty.tools.dotc.Run.compile(Run.scala:120)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:29)
at dotty.tools.dotc.Driver.process(Driver.scala:127)
at dotty.tools.dotc.Driver.process(Driver.scala:96)
at dotty.tools.dotc.Driver.process(Driver.scala:108)
at dotty.tools.dotc.Driver.main(Driver.scala:135)
at dotty.tools.dotc.Main.main(Main.scala)