File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -3902,7 +3902,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39023902 case _ => ()
39033903
39043904 val args = implicitArgs(wtp.paramInfos, 0 , pt)
3905- if (args.tpes.exists(_.isInstanceOf [SearchFailureType ])) {
3905+ val firstFailure = args.tpes.find(_.isInstanceOf [SearchFailureType ])
3906+ if (firstFailure.isDefined) {
39063907 // If there are several arguments, some arguments might already
39073908 // have influenced the context, binding variables, but later ones
39083909 // might fail. In that case the constraint and instantiated variables
@@ -3938,10 +3939,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39383939
39393940 retyped
39403941 else
3941- val firstNonAmbiguous = args.tpes.find(tp => tp.isError && ! tp.isInstanceOf [AmbiguousImplicits ])
3942- def firstError = args.tpes.find(_.isError)
3943- val errorType = firstNonAmbiguous.orElse(firstError).getOrElse(NoType )
3944- val res = untpd.Apply (tree, args).withType(errorType)
3942+ val res = untpd.Apply (tree, args).withType(firstFailure.get)
39453943 reportErrors(res, wtp)
39463944 res
39473945 }
You can’t perform that action at this time.
0 commit comments