@@ -4473,12 +4473,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44734473 def argHasDefault = hasDefaultParams && ! defaultArg.isEmpty
44744474
44754475 def canProfitFromMoreConstraints =
4476+ ! ctx.mode.is(Mode .ImplicitExploration )
4477+ && {
44764478 arg.tpe.isInstanceOf [AmbiguousImplicits ]
44774479 // Ambiguity could be decided by more constraints
44784480 || ! isFullyDefined(formal, ForceDegree .none) && ! argHasDefault
44794481 // More context might constrain type variables which could make implicit scope larger.
44804482 // But in this case we should search with additional arguments typed only if there
44814483 // is no default argument.
4484+ }
44824485
44834486 // Try to constrain the result using `pt1`, but back out if a BadTyperStateAssertion
44844487 // is thrown. TODO Find out why the bad typer state arises and prevent it. The try-catch
@@ -4585,10 +4588,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
45854588 issueErrors(tree, args, failureType)
45864589 else
45874590 val app = cpy.Apply (tree)(untpd.TypedSplice (tree), namedArgs)
4588- // old-style implicit needs to be marked using so that implicits are searched
4589- val needsUsing = wtp.isImplicitMethod || wtp.match
4591+ // avoid warning if method is old-style implicit that context bounds will be contextual
4592+ val needsUsing = wtp.isContextualMethod || wtp.match
45904593 case MethodType (ContextBoundParamName (_) :: _) => sourceVersion.isAtLeast(`3.4`)
45914594 case _ => false
4595+ // it is benign to always set apply kind; typedApply may redundantly search missing implicits
4596+ // because it doesn't distinguish adaptNoArgs from explicit application
45924597 if needsUsing then app.setApplyKind(ApplyKind .Using )
45934598 typr.println(i " try with default implicit args $app" )
45944599 // If the retyped tree still has an error type and is an `Apply`
0 commit comments