We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23cc07f commit b91ad9bCopy full SHA for b91ad9b
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4286,11 +4286,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4286
}
4287
4288
val pt1 = pt.deepenProtoTrans
4289
- tryConstrainType(pt1)
+ val isConstrained = tryConstrainType(pt1)
4290
val arg = inferImplicitArg(formal, tree.span.endPos)
4291
arg.tpe match
4292
case failed: AmbiguousImplicits =>
4293
- if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
+ if !isConstrained && (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
4294
then implicitArgs(formals, argIndex, pt)
4295
else arg :: implicitArgs(formals1, argIndex + 1, pt)
4296
case failed: SearchFailureType =>
0 commit comments