summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-05-19 02:21:48 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-05-19 02:21:48 -0700
commit8cb13b1017ef6ed8281964c51df48d4bb9dcaa99 (patch)
tree5a83a30e747c6a90f383dee6f3ce902c09407f65 /src
parent5b9bf3d7124e8ba6e27953fa5cc00367614ecf5b (diff)
parent7490250efe8e7b59be9d168048f40344b3066b61 (diff)
downloadscala-8cb13b1017ef6ed8281964c51df48d4bb9dcaa99.tar.gz
scala-8cb13b1017ef6ed8281964c51df48d4bb9dcaa99.tar.bz2
scala-8cb13b1017ef6ed8281964c51df48d4bb9dcaa99.zip
Merge pull request #568 from hubertp/issue/5801
Fix SI-5801: error messages regression.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 7419ec3bce..e40a567f1d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -114,6 +114,8 @@ trait Typers extends Modes with Adaptations with Taggings {
case MethodType(params, _) =>
val argResultsBuff = new ListBuffer[SearchResult]()
val argBuff = new ListBuffer[Tree]()
+ // paramFailed cannot be initialized with params.exists(_.tpe.isError) because that would
+ // hide some valid errors for params preceding the erroneous one.
var paramFailed = false
def mkPositionalArg(argTree: Tree, paramName: Name) = argTree
@@ -129,7 +131,7 @@ trait Typers extends Modes with Adaptations with Taggings {
for(ar <- argResultsBuff)
paramTp = paramTp.subst(ar.subst.from, ar.subst.to)
- val res = if (paramFailed) SearchFailure else inferImplicit(fun, paramTp, context.reportErrors, false, context)
+ val res = if (paramFailed || (paramTp.isError && {paramFailed = true; true})) SearchFailure else inferImplicit(fun, paramTp, context.reportErrors, false, context)
argResultsBuff += res
if (res != SearchFailure) {