summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2012-05-16 17:39:29 +0200
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2012-05-18 10:36:40 +0200
commit7490250efe8e7b59be9d168048f40344b3066b61 (patch)
tree66813e2778b56926bdbecd80779925562b36c727 /src
parent97046e6cbe8dfc5d5b672d1a490071b68cbdad9a (diff)
downloadscala-7490250efe8e7b59be9d168048f40344b3066b61.tar.gz
scala-7490250efe8e7b59be9d168048f40344b3066b61.tar.bz2
scala-7490250efe8e7b59be9d168048f40344b3066b61.zip
Fixes SI-5801, error messages regression. Review by @adriaanm
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 8c2eae1c86..58ea78af6b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -109,6 +109,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
@@ -124,7 +126,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) {