summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2012-03-06 16:19:30 +0100
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2012-03-06 16:19:30 +0100
commit6bcea98c0ecd89efbc106d955345359855860cfa (patch)
tree498bc296b8fa669e0a0a42c6c6073b5b94b8e735 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
parentf536200672177c3e42251477eab9121c2c384d72 (diff)
downloadscala-6bcea98c0ecd89efbc106d955345359855860cfa.tar.gz
scala-6bcea98c0ecd89efbc106d955345359855860cfa.tar.bz2
scala-6bcea98c0ecd89efbc106d955345359855860cfa.zip
Closes #SI-5554
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index ea5223e32f..e290a5193c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -716,7 +716,6 @@ trait ContextErrors {
// we have to set the type of tree to ErrorType only in the very last
// fallback action that is done in the inference (tracking it manually is error prone).
// This avoids entering infinite loop in doTypeApply.
- // TODO: maybe we should do the same thing with inferExprAlternative.
if (implicitly[Context].reportErrors) setError(tree)
}
@@ -726,6 +725,8 @@ trait ContextErrors {
"argument types " + argtpes.mkString("(", ",", ")") +
(if (pt == WildcardType) "" else " and expected result type " + pt)
val (pos, msg) = ambiguousErrorMsgPos(tree.pos, pre, best, firstCompeting, msg0)
+ // discover last attempt in a similar way as for NoBestMethodAlternativeError
+ if (implicitly[Context].ambiguousErrors) setError(tree)
issueAmbiguousTypeError(pre, best, firstCompeting, AmbiguousTypeError(tree, pos, msg))
}