@@ -4406,6 +4406,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4406
4406
/** Reports errors for arguments of `appTree` that have a `SearchFailureType`.
4407
4407
*/
4408
4408
def issueErrors (fun : Tree , args : List [Tree ], failureType : Type ): Tree =
4409
+ // If there are several arguments, some arguments might already
4410
+ // have influenced the context, binding variables, but later ones
4411
+ // might fail. In that case the constraint and instantiated variables
4412
+ // need to be reset.
4413
+ ctx.typerState.resetTo(saved)
4414
+
4409
4415
val errorType = failureType match
4410
4416
case ai : AmbiguousImplicits => ai.asNested
4411
4417
case tp => tp
@@ -4426,12 +4432,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4426
4432
val args = implicitArgs(wtp.paramInfos, 0 , pt)
4427
4433
val failureType = propagatedFailure(args)
4428
4434
if failureType.exists then
4429
- // If there are several arguments, some arguments might already
4430
- // have influenced the context, binding variables, but later ones
4431
- // might fail. In that case the constraint and instantiated variables
4432
- // need to be reset.
4433
- ctx.typerState.resetTo(saved)
4434
-
4435
4435
// If method has default params, fall back to regular application
4436
4436
// where all inferred implicits are passed as named args.
4437
4437
if hasDefaultParams && ! failureType.isInstanceOf [AmbiguousImplicits ] then
0 commit comments