File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,7 @@ object Implicits:
431431
432432 /** A failed search */
433433 case class SearchFailure (tree : Tree ) extends SearchResult {
434+ require(tree.tpe.isInstanceOf [SearchFailureType ], s " unexpected type for ${tree}" )
434435 final def isAmbiguous : Boolean = tree.tpe.isInstanceOf [AmbiguousImplicits | TooUnspecific ]
435436 final def reason : SearchFailureType = tree.tpe.asInstanceOf [SearchFailureType ]
436437 }
Original file line number Diff line number Diff line change @@ -3625,8 +3625,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
36253625 val remembered = // report AmbiguousReferences as priority, otherwise last error
36263626 (errs.filter(_.msg.isInstanceOf [AmbiguousReference ]) ++ errs).take(1 )
36273627 for err <- remembered do
3628+ val tree = if app.isEmpty then qual else app
36283629 rememberSearchFailure(qual,
3629- SearchFailure (app .withType(FailedExtension (app , selectionProto, err.msg))))
3630+ SearchFailure (tree .withType(FailedExtension (tree , selectionProto, err.msg))))
36303631 catch case ex : TypeError => nestedFailure(ex)
36313632
36323633 // try an implicit conversion or given extension
You can’t perform that action at this time.
0 commit comments