File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4250,11 +4250,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4250
4250
else formals1
4251
4251
implicitArgs(formals2, argIndex + 1 , pt)
4252
4252
4253
- val pt1 = pt.deepenProtoTrans
4254
- if ((pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)) {
4255
- return implicitArgs(formals, argIndex, pt1)
4253
+ val newctx = ctx.fresh.setNewTyperState()
4254
+ val pt1 = pt.deepenProtoTrans(using newctx)
4255
+ val arg = if ((pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)(using newctx)) {
4256
+ inferImplicitArg(formal, tree.span.endPos)(using newctx)
4257
+ } else {
4258
+ inferImplicitArg(formal, tree.span.endPos)
4256
4259
}
4257
- val arg = inferImplicitArg(formal, tree.span.endPos)
4258
4260
arg.tpe match
4259
4261
case failed : AmbiguousImplicits =>
4260
4262
arg :: implicitArgs(formals1, argIndex + 1 , pt1)
You can’t perform that action at this time.
0 commit comments