File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4286,11 +4286,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4286
4286
}
4287
4287
4288
4288
val pt1 = pt.deepenProtoTrans
4289
- tryConstrainType(pt1)
4289
+ val isConstrained = tryConstrainType(pt1)
4290
4290
val arg = inferImplicitArg(formal, tree.span.endPos)
4291
4291
arg.tpe match
4292
4292
case failed : AmbiguousImplicits =>
4293
- if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
4293
+ if ! isConstrained && (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
4294
4294
then implicitArgs(formals, argIndex, pt)
4295
4295
else arg :: implicitArgs(formals1, argIndex + 1 , pt)
4296
4296
case failed : SearchFailureType =>
You can’t perform that action at this time.
0 commit comments