@@ -1318,17 +1318,19 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
1318
1318
def searchImplicit (sym : TermSymbol , tpt : Tree ) = {
1319
1319
val evTyper = new Typer (ctx.nestingLevel + 1 )
1320
1320
val evCtx = ctx.fresh.setTyper(evTyper)
1321
- val evidence = evTyper.inferImplicitArg(tpt.tpe, tpt.span)(using evCtx)
1322
- evidence.tpe match {
1323
- case fail : Implicits .AmbiguousImplicits =>
1324
- report.error(evTyper.missingArgMsg(evidence, tpt.tpe, " " ), tpt.srcPos)
1325
- true // hard error: return true to stop implicit search here
1326
- case fail : Implicits .SearchFailureType =>
1327
- false
1328
- case _ =>
1329
- // inlining.println(i"inferred implicit $sym: ${sym.info} with $evidence: ${evidence.tpe.widen}, ${evCtx.gadt.constraint}, ${evCtx.typerState.constraint}")
1330
- newTermBinding(sym, evidence)
1331
- true
1321
+ inContext(evCtx) {
1322
+ val evidence = evTyper.inferImplicitArg(tpt.tpe, tpt.span)
1323
+ evidence.tpe match {
1324
+ case fail : Implicits .AmbiguousImplicits =>
1325
+ report.error(evTyper.missingArgMsg(evidence, tpt.tpe, " " ), tpt.srcPos)
1326
+ true // hard error: return true to stop implicit search here
1327
+ case fail : Implicits .SearchFailureType =>
1328
+ false
1329
+ case _ =>
1330
+ // inlining.println(i"inferred implicit $sym: ${sym.info} with $evidence: ${evidence.tpe.widen}, ${evCtx.gadt.constraint}, ${evCtx.typerState.constraint}")
1331
+ newTermBinding(sym, evidence)
1332
+ true
1333
+ }
1332
1334
}
1333
1335
}
1334
1336
0 commit comments