aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-09 20:30:45 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-09 20:30:45 +0100
commit9e63bf253c169d6b2a2e74f65b3a4029f0781655 (patch)
tree60a32026e158fc8dc58b5cc54a8516dce5306b82 /src/dotty/tools/dotc/typer/Typer.scala
parent0a8eb5087744c44dc67c2d79ce63e993c3ac0ed0 (diff)
downloaddotty-9e63bf253c169d6b2a2e74f65b3a4029f0781655.tar.gz
dotty-9e63bf253c169d6b2a2e74f65b3a4029f0781655.tar.bz2
dotty-9e63bf253c169d6b2a2e74f65b3a4029f0781655.zip
Better error message for failed overloading resolution.
Indicate only thhose alternatives that remain after narrowing.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 4c55b9d4f..b3511841d 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1117,9 +1117,10 @@ class Typer extends Namer with Applications with Implicits {
noMatches
}
case alts =>
- def all = if (altDenots.length == 2) "both" else "all"
+ val remainingDenots = alts map (_.denot.asInstanceOf[SingleDenotation])
+ def all = if (remainingDenots.length == 2) "both" else "all"
errorTree(tree,
- i"""Ambiguous overload. The ${err.overloadedAltsStr(altDenots)}
+ i"""Ambiguous overload. The ${err.overloadedAltsStr(remainingDenots)}
|$all match $expectedStr""".stripMargin)
}
}