Skip to content

MatchError parser stability crash #7813

Closed
@sir-wabbit

Description

@sir-wabbit

minimized code

implicit def f[X <: Undefined](implicit a: Int): X = ???
def g(arg: h.NonExistent): Int = ???
val h: Int = ???
Stack trace
-- [E006] Unbound Identifier Error: testing/Test.scala:1:20 --------------------
1 |implicit def f[X <: Undefined](implicit a: Int): X = ???
  |                    ^^^^^^^^^
  |                    Not found: type Undefined

longer explanation available when compiling with `-explain`
exception occurred while typechecking testing/Test.scala
exception occurred while compiling testing/Test.scala
scala.MatchError: SelectionProto(NonExistent,class dotty.tools.dotc.typer.ProtoTypes$IgnoredProto,dotty.tools.dotc.typer.Typer@6e106680,false) (of class dotty.tools.dotc.typer.ProtoTypes$CachedSelectionProto) while compiling testing/Test.scala
Exception in thread "main" scala.MatchError: SelectionProto(NonExistent,class dotty.tools.dotc.typer.ProtoTypes$IgnoredProto,dotty.tools.dotc.typer.Typer@6e106680,false) (of class dotty.tools.dotc.typer.ProtoTypes$CachedSelectionProto)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.typedImplicit(Implicits.scala:1405)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.tryImplicit(Implicits.scala:1443)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.rank$1(Implicits.scala:1523)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicits(Implicits.scala:1616)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1637)
	at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1317)
	at dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:83)
	at dotty.tools.dotc.typer.Implicits.inferView(Implicits.scala:675)
	at dotty.tools.dotc.typer.Typer.inferView(Typer.scala:83)
	at dotty.tools.dotc.typer.Typer.adaptToSubType$1(Typer.scala:3050)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsOther$6(Typer.scala:2881)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:2933)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3139)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2544)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2333)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:478)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:502)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2099)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1260)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1253)
	at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1260)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1449)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:811)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:935)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2071)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2096)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1253)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.completeParams$$anonfun$1(Namer.scala:1278)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer.completeParams(Namer.scala:1278)
	at dotty.tools.dotc.typer.Namer.defDefSig$$anonfun$3(Namer.scala:1488)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1488)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:815)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:935)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2071)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2096)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2247)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2291)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1784)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2109)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2247)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2291)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1910)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2150)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2177)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2333)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree1$2(FrontEnd.scala:78)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:83)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:84)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:114)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:114)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:171)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:186)
	at dotty.tools.dotc.Run.compileSources(Run.scala:123)
	at dotty.tools.dotc.Run.compile(Run.scala:106)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
	at dotty.tools.dotc.Driver.process(Driver.scala:189)
	at dotty.tools.dotc.Driver.process(Driver.scala:158)
	at dotty.tools.dotc.Driver.process(Driver.scala:170)
	at dotty.tools.dotc.Driver.main(Driver.scala:197)
	at dotty.tools.dotc.Main.main(Main.scala)

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