@@ -2900,6 +2900,7 @@ class Typer extends Namer
2900
2900
def dummyArg (tp : Type ) = untpd.Ident (nme.??? ).withTypeUnchecked(tp)
2901
2901
2902
2902
def addImplicitArgs (using Context ) = {
2903
+ def hasDefaultParams = methPart(tree).symbol.hasDefaultParams
2903
2904
def implicitArgs (formals : List [Type ], argIndex : Int , pt : Type ): List [Tree ] = formals match {
2904
2905
case Nil => Nil
2905
2906
case formal :: formals1 =>
@@ -2909,7 +2910,7 @@ class Typer extends Namer
2909
2910
val pt1 = pt.deepenProto
2910
2911
if ((pt1 `ne` pt) && constrainResult(tree.symbol, wtp, pt1)) implicitArgs(formals, argIndex, pt1)
2911
2912
else arg :: implicitArgs(formals1, argIndex + 1 , pt1)
2912
- case failed : SearchFailureType if ! tree.symbol. hasDefaultParams =>
2913
+ case failed : SearchFailureType if ! hasDefaultParams =>
2913
2914
// no need to search further, the adapt fails in any case
2914
2915
// the reason why we continue inferring arguments in case of an AmbiguousImplicits
2915
2916
// is that we need to know whether there are further errors.
@@ -2965,7 +2966,7 @@ class Typer extends Namer
2965
2966
2966
2967
// If method has default params, fall back to regular application
2967
2968
// where all inferred implicits are passed as named args.
2968
- if (methPart(tree).symbol. hasDefaultParams && ! propFail.isInstanceOf [AmbiguousImplicits ]) {
2969
+ if hasDefaultParams && ! propFail.isInstanceOf [AmbiguousImplicits ] then
2969
2970
val namedArgs = wtp.paramNames.lazyZip(args).flatMap { (pname, arg) =>
2970
2971
if (arg.tpe.isError) Nil else untpd.NamedArg (pname, untpd.TypedSplice (arg)) :: Nil
2971
2972
}
@@ -2977,7 +2978,6 @@ class Typer extends Namer
2977
2978
} { (_, _) =>
2978
2979
issueErrors()
2979
2980
}
2980
- }
2981
2981
else issueErrors()
2982
2982
}
2983
2983
else tree match {
0 commit comments