summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-08-29 10:27:26 -0700
committerPaul Phillips <paulp@improving.org>2013-08-29 10:27:26 -0700
commit7c8b6369aaaac1317a04baeba5df5c47f2d7a731 (patch)
treea40dd8423ccba98ce0f3b38196feedbcdff7b92a /src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
parent09058cff51cac263e7f476f97c79e6d41ee59cc9 (diff)
downloadscala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.tar.gz
scala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.tar.bz2
scala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.zip
Limit bad advice given for erroneous pattern.
Don't suggest "_: <none>" as an alternative when the pattern type doesn't conform to the expected type.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index 0c5f798c23..13fa2a947d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -285,8 +285,8 @@ trait TypeDiagnostics {
case xs => xs map (_ => "_") mkString (clazz.name + "[", ",", "]")
})+ "`"
- "\nNote: if you intended to match against the class, try "+ caseString
-
+ if (!clazz.exists) ""
+ else "\nNote: if you intended to match against the class, try "+ caseString
}
case class TypeDiag(tp: Type, sym: Symbol) extends Ordered[TypeDiag] {