summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--test/files/neg/catch-all.check6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c74da7f2a9..43697f3b1b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4935,7 +4935,7 @@ trait Typers extends Modes with Adaptations with Tags {
var catches1 = typedCases(catches, ThrowableClass.tpe, pt)
for (cdef <- catches1 if cdef.guard.isEmpty) {
- def warn(name: Name) = context.warning(cdef.pat.pos, s"This catches all Throwables. If this is really intended, use `case ${name.decoded} : Throwable` to clear this warning.")
+ def warn(name: Name) = context.warning(cdef.pat.pos, s"This catches all Throwables. If this is really intended, use `case ${name.decoded}: Throwable` to clear this warning.")
def unbound(t: Tree) = t.symbol == null || t.symbol == NoSymbol
cdef.pat match {
case Bind(name, i@Ident(_)) if unbound(i) => warn(name)
diff --git a/test/files/neg/catch-all.check b/test/files/neg/catch-all.check
index 62f895cc7e..a9cd0ba927 100644
--- a/test/files/neg/catch-all.check
+++ b/test/files/neg/catch-all.check
@@ -1,10 +1,10 @@
-catch-all.scala:2: error: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning.
+catch-all.scala:2: error: This catches all Throwables. If this is really intended, use `case _: Throwable` to clear this warning.
try { "warn" } catch { case _ => }
^
-catch-all.scala:4: error: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning.
+catch-all.scala:4: error: This catches all Throwables. If this is really intended, use `case x: Throwable` to clear this warning.
try { "warn" } catch { case x => }
^
-catch-all.scala:6: error: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning.
+catch-all.scala:6: error: This catches all Throwables. If this is really intended, use `case x: Throwable` to clear this warning.
try { "warn" } catch { case _: RuntimeException => ; case x => }
^
three errors found