@@ -1220,7 +1220,7 @@ trait Implicits:
12201220 assert(argument.isEmpty || argument.tpe.isValueType || argument.tpe.isInstanceOf [ExprType ],
12211221 em " found: $argument: ${argument.tpe}, expected: $pt" )
12221222
1223- private def nestedContext () =
1223+ private def searchContext () =
12241224 ctx.fresh.setMode(ctx.mode &~ Mode .ImplicitsEnabled )
12251225
12261226 private def isCoherent = pt.isRef(defn.CanEqualClass )
@@ -1264,7 +1264,7 @@ trait Implicits:
12641264 else
12651265 val history = ctx.searchHistory.nest(cand, pt)
12661266 val typingCtx =
1267- nestedContext ().setNewTyperState().setFreshGADTBounds.setSearchHistory(history)
1267+ searchContext ().setNewTyperState().setFreshGADTBounds.setSearchHistory(history)
12681268 val result = typedImplicit(cand, pt, argument, span)(using typingCtx)
12691269 result match
12701270 case res : SearchSuccess =>
@@ -1291,7 +1291,7 @@ trait Implicits:
12911291 def compareAlternatives (alt1 : RefAndLevel , alt2 : RefAndLevel ): Int =
12921292 if alt1.ref eq alt2.ref then 0
12931293 else if alt1.level != alt2.level then alt1.level - alt2.level
1294- else explore(compare(alt1.ref, alt2.ref))(using nestedContext ())
1294+ else explore(compare(alt1.ref, alt2.ref))(using searchContext ())
12951295
12961296 /** If `alt1` is also a search success, try to disambiguate as follows:
12971297 * - If alt2 is preferred over alt1, pick alt2, otherwise return an
@@ -1326,7 +1326,7 @@ trait Implicits:
13261326 else
13271327 ctx.typerState
13281328
1329- diff = inContext(ctx .withTyperState(comparisonState)) {
1329+ diff = inContext(searchContext() .withTyperState(comparisonState)) {
13301330 compare(ref1, ref2)
13311331 }
13321332 case _ =>
0 commit comments