@@ -4406,6 +4406,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44064406 /** Reports errors for arguments of `appTree` that have a `SearchFailureType`.
44074407 */
44084408 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+
44094415 val errorType = failureType match
44104416 case ai : AmbiguousImplicits => ai.asNested
44114417 case tp => tp
@@ -4426,12 +4432,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
44264432 val args = implicitArgs(wtp.paramInfos, 0 , pt)
44274433 val failureType = propagatedFailure(args)
44284434 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-
44354435 // If method has default params, fall back to regular application
44364436 // where all inferred implicits are passed as named args.
44374437 if hasDefaultParams && ! failureType.isInstanceOf [AmbiguousImplicits ] then
0 commit comments