File tree 1 file changed +3
-5
lines changed
compiler/src/dotty/tools/dotc/typer 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -3833,7 +3833,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3833
3833
case _ => ()
3834
3834
3835
3835
val args = implicitArgs(wtp.paramInfos, 0 , pt)
3836
- if (args.tpes.exists(_.isInstanceOf [SearchFailureType ])) {
3836
+ val firstFailure = args.tpes.find(_.isInstanceOf [SearchFailureType ])
3837
+ if (firstFailure.isDefined) {
3837
3838
// If there are several arguments, some arguments might already
3838
3839
// have influenced the context, binding variables, but later ones
3839
3840
// might fail. In that case the constraint and instantiated variables
@@ -3866,10 +3867,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3866
3867
3867
3868
retyped
3868
3869
else
3869
- val firstNonAmbiguous = args.tpes.find(tp => tp.isError && ! tp.isInstanceOf [AmbiguousImplicits ])
3870
- def firstError = args.tpes.find(_.isError)
3871
- val errorType = firstNonAmbiguous.orElse(firstError).getOrElse(NoType )
3872
- val res = untpd.Apply (tree, args).withType(errorType)
3870
+ val res = untpd.Apply (tree, args).withType(firstFailure.get)
3873
3871
reportErrors(res, wtp)
3874
3872
res
3875
3873
}
You can’t perform that action at this time.
0 commit comments