From 7c8b6369aaaac1317a04baeba5df5c47f2d7a731 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 29 Aug 2013 10:27:26 -0700 Subject: Limit bad advice given for erroneous pattern. Don't suggest "_: " as an alternative when the pattern type doesn't conform to the expected type. --- src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala') 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] { -- cgit v1.2.3