@@ -4174,7 +4174,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
41744174 Some (adapt(tree, pt, locked))
41754175 else
41764176 val selProto = SelectionProto (name, pt, NoViewsAllowed , privateOK = false , tree.nameSpan)
4177- if selProto.isMatchedBy(qual.tpe) || tree.hasAttachment(InsertedImplicitOnQualifier ) then
4177+ if selProto.isMatchedBy(qual.tpe, keepConstraint = false ) || tree.hasAttachment(InsertedImplicitOnQualifier )
4178+ then
41784179 None
41794180 else
41804181 tryEither {
@@ -4491,7 +4492,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44914492 arg.tpe match
44924493 case failed : SearchFailureType if canProfitFromMoreConstraints =>
44934494 val pt1 = pt.deepenProtoTrans
4494- if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && tryConstrainResult(pt1) then
4495+ if (pt1 ne pt) && (pt1 ne sharpenedPt) && tryConstrainResult(pt1) then
44954496 return implicitArgs(formals, argIndex, pt1)
44964497 case _ =>
44974498
@@ -4605,13 +4606,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
46054606 // Reset context in case it was set to a supercall context before.
46064607 // otherwise the invariant for taking another this or super call context is not met.
46074608 // Test case is i20483.scala
4608- tree match
4609- case tree : Block =>
4610- readaptSimplified(tpd.Block (tree.stats, tpd.Apply (tree.expr, args)))
4611- case tree : NamedArg =>
4612- readaptSimplified(tpd.NamedArg (tree.name, tpd.Apply (tree.arg, args)))
4613- case _ =>
4614- readaptSimplified(tpd.Apply (tree, args))
4609+ val cpy = tree match
4610+ case tree : Block => tpd.Block (tree.stats, tpd.Apply (tree.expr, args))
4611+ case tree : NamedArg => tpd.NamedArg (tree.name, tpd.Apply (tree.arg, args))
4612+ case _ => tpd.Apply (tree, args)
4613+ readaptSimplified(cpy)
46154614 end addImplicitArgs
46164615
46174616 pt.revealIgnored match {
0 commit comments