summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-28 06:45:29 +0000
committerPaul Phillips <paulp@improving.org>2010-11-28 06:45:29 +0000
commitb810d8c4012d1b09fa95181790722b60967be3fc (patch)
treefff3563f81f12a92df00ce858bde850067f3aefd /src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
parent98569e2464292054c1b5629ad7eff4a4a3dd7381 (diff)
downloadscala-b810d8c4012d1b09fa95181790722b60967be3fc.tar.gz
scala-b810d8c4012d1b09fa95181790722b60967be3fc.tar.bz2
scala-b810d8c4012d1b09fa95181790722b60967be3fc.zip
Did some more polishing on the infamous partial...
Did some more polishing on the infamous partial function error message. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index 99c85f72f1..ebcd3c3777 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -145,11 +145,15 @@ trait TypeDiagnostics {
def alternativesString(tree: Tree) =
alternatives(tree) map (x => " " + methodTypeErrorString(x)) mkString ("", " <and>\n", "\n")
- def missingParameterTypeMsg(fun: Tree, vparam: ValDef) = {
+ def missingParameterTypeMsg(fun: Tree, vparam: ValDef, pt: Type) = {
+ def anonMessage = (
+ "\nThe argument types of an anonymous function must be fully known. (SLS 8.5)" +
+ "\nExpected type was: " + pt.toLongString
+ )
val suffix =
if (!vparam.mods.isSynthetic) ""
else " for expanded function" + (fun match {
- case Function(_, Match(_, _)) => "\n(see SLS 8.5, \"Pattern Matching Anonymous Functions\")"
+ case Function(_, Match(_, _)) => anonMessage
case _ => " " + fun
})