summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-15 12:14:43 -0800
committerPaul Phillips <paulp@improving.org>2012-02-15 12:20:59 -0800
commit9655fafbc89b650b92f239aa7f69df7a16e3542b (patch)
treeeac4bd29981bf2cc2a09dfc8a56a5b080c612b54 /src/compiler
parenta29173afd1e1b4d840a2badaa36ac97f60225044 (diff)
downloadscala-9655fafbc89b650b92f239aa7f69df7a16e3542b.tar.gz
scala-9655fafbc89b650b92f239aa7f69df7a16e3542b.tar.bz2
scala-9655fafbc89b650b92f239aa7f69df7a16e3542b.zip
Revert "Make fix for SI-5452 not break other things."
This reverts commit a725bf982c06e16c5d533ea6b2227b726db4f7e4.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala7
2 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index 6ee09d064f..466b5125a8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -714,9 +714,11 @@ trait ContextErrors {
setError(tree)
}
- def NoBestMethodAlternativeError(tree: Tree, argtpes: List[Type], pt: Type) =
+ def NoBestMethodAlternativeError(tree: Tree, argtpes: List[Type], pt: Type) = {
issueNormalTypeError(tree,
applyErrorMsg(tree, " cannot be applied to ", argtpes, pt))
+ setError(tree)
+ }
def AmbiguousMethodAlternativeError(tree: Tree, pre: Type, best: Symbol,
firstCompeting: Symbol, argtpes: List[Type], pt: Type) = {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index acf905d974..b97fbebec2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1466,9 +1466,7 @@ trait Infer {
argtpes: List[Type], pt0: Type, varArgsOnly: Boolean = false): Unit = tree.tpe match {
case OverloadedType(pre, alts) =>
val pt = if (pt0.typeSymbol == UnitClass) WildcardType else pt0
- var secondTry = true
tryTwice {
- secondTry = !secondTry
debuglog("infer method alt "+ tree.symbol +" with alternatives "+
(alts map pre.memberType) +", argtpes = "+ argtpes +", pt = "+ pt)
@@ -1490,11 +1488,8 @@ trait Infer {
if (improves(alt, best)) alt else best)
val competing = applicable.dropWhile(alt => best == alt || improves(best, alt))
if (best == NoSymbol) {
- if (pt == WildcardType) {
+ if (pt == WildcardType)
NoBestMethodAlternativeError(tree, argtpes, pt)
- if (secondTry)
- setError(tree)
- }
else
inferMethodAlternative(tree, undetparams, argtpes, WildcardType)
} else if (!competing.isEmpty) {