From 5f491e5d037b799476747f0dee6ea50fe87c269b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 7 Mar 2011 11:50:25 +0000 Subject: Raised the scariness of the case class deprecat... Raised the scariness of the case class deprecation message. (I hope you don't mind, hubert, I like writing scary messages.) Closes #4109 I suppose, no review. --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 649af74d43..cf28ea24fe 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1011,12 +1011,13 @@ trait Typers extends Modes { // "change your code now!" as there are material bugs (which are very unlikely // to be fixed) associated with case class inheritance. if (!phase.erasedTypes) { - for (ancestor <- clazz.ancestors find (_.isCase)) + for (ancestor <- clazz.ancestors find (_.isCase)) { unit.deprecationWarning(clazz.pos, ( - "case class `%s' has case class ancestor `%s'. This has been deprecated " + - "for unduly complicating both usage and implementation. You should instead " + - "use extractors for pattern matching on non-leaf nodes." ).format(clazz, ancestor) - ) + "case class `%s' has case ancestor `%s'. Case inheritance has potentially "+ + "dangerous bugs which are unlikely to be fixed. You are strongly encouraged to "+ + "instead use extractors to pattern match on non-leaf nodes." + ).format(clazz, ancestor)) + } } } -- cgit v1.2.3