@@ -4148,7 +4148,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
41484148 Some (adapt(tree, pt, locked))
41494149 else
41504150 val selProto = SelectionProto (name, pt, NoViewsAllowed , privateOK = false , tree.nameSpan)
4151- if selProto.isMatchedBy(qual.tpe) || tree.hasAttachment(InsertedImplicitOnQualifier ) then
4151+ if selProto.isMatchedBy(qual.tpe, keepConstraint = false ) || tree.hasAttachment(InsertedImplicitOnQualifier )
4152+ then
41524153 None
41534154 else
41544155 tryEither {
@@ -4465,7 +4466,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44654466 arg.tpe match
44664467 case failed : SearchFailureType if canProfitFromMoreConstraints =>
44674468 val pt1 = pt.deepenProtoTrans
4468- if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && tryConstrainResult(pt1) then
4469+ if (pt1 ne pt) && (pt1 ne sharpenedPt) && tryConstrainResult(pt1) then
44694470 return implicitArgs(formals, argIndex, pt1)
44704471 case _ =>
44714472
@@ -4579,13 +4580,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
45794580 // Reset context in case it was set to a supercall context before.
45804581 // otherwise the invariant for taking another this or super call context is not met.
45814582 // Test case is i20483.scala
4582- tree match
4583- case tree : Block =>
4584- readaptSimplified(tpd.Block (tree.stats, tpd.Apply (tree.expr, args)))
4585- case tree : NamedArg =>
4586- readaptSimplified(tpd.NamedArg (tree.name, tpd.Apply (tree.arg, args)))
4587- case _ =>
4588- readaptSimplified(tpd.Apply (tree, args))
4583+ val cpy = tree match
4584+ case tree : Block => tpd.Block (tree.stats, tpd.Apply (tree.expr, args))
4585+ case tree : NamedArg => tpd.NamedArg (tree.name, tpd.Apply (tree.arg, args))
4586+ case _ => tpd.Apply (tree, args)
4587+ readaptSimplified(cpy)
45894588 end addImplicitArgs
45904589
45914590 pt.revealIgnored match {
0 commit comments