summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-07-13 08:05:04 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-07-13 08:05:04 +0000
commit8a0d130537be8c3716ab9191d84c53d39aaa1804 (patch)
tree8517ab3b5e82f4bb681f048e702b96f8e9d2d0fc /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent038fef39ad4310fc3fe1c5324b004e42fd0036b3 (diff)
downloadscala-8a0d130537be8c3716ab9191d84c53d39aaa1804.tar.gz
scala-8a0d130537be8c3716ab9191d84c53d39aaa1804.tar.bz2
scala-8a0d130537be8c3716ab9191d84c53d39aaa1804.zip
prohibit case-to-case inheritance instead of is...
prohibit case-to-case inheritance instead of issuing warning. closes #4109. review by extempore, since it should make your life much easier in the pattern matcher
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 97e07d9f3e..1988bc887f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -50,7 +50,6 @@ trait Typers extends Modes {
resetNamer()
resetImplicits()
transformed.clear()
- resetSynthetics()
}
object UnTyper extends Traverser {
@@ -1076,10 +1075,9 @@ trait Typers extends Modes {
private def validateNoCaseAncestor(clazz: Symbol) = {
if (!phase.erasedTypes) {
for (ancestor <- clazz.ancestors find (_.isCase)) {
- unit.deprecationWarning(clazz.pos, (
- "case class `%s' has case ancestor `%s'. Case-to-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."
+ unit.error(clazz.pos, (
+ "case class `%s' has case ancestor `%s'. Case-to-case inheritance is prohibited."+
+ " To overcome this limitation use extractors to pattern match on non-leaf nodes."
).format(clazz, ancestor))
}
}