summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-04-05 13:48:28 +0000
committerMartin Odersky <odersky@gmail.com>2006-04-05 13:48:28 +0000
commit87185f98441fc73835c100cf4170e9d9bb31c328 (patch)
tree350dd0e290757e9c8503a38c43f06a60f17d7733 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parentc05862755062fd2827c825f055ae3e7f7990aadd (diff)
downloadscala-87185f98441fc73835c100cf4170e9d9bb31c328.tar.gz
scala-87185f98441fc73835c100cf4170e9d9bb31c328.tar.bz2
scala-87185f98441fc73835c100cf4170e9d9bb31c328.zip
fixed bug562 and bug563
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 41cfdf30bf..e88545992c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -176,8 +176,12 @@ abstract class RefChecks extends InfoTransform {
overrideError("needs `override' modifier");
} else if ((other hasFlag ABSOVERRIDE) && other.isIncompleteIn(clazz) && !(member hasFlag ABSOVERRIDE)) {
overrideError("needs `abstract override' modifiers");
- } else if (other.isStable && !member.isStable) { // (1.4)
- overrideError("needs to be an immutable value");
+ } else if (other.isStable) {
+ if (!member.isStable) // (1.4)
+ overrideError("needs to be an immutable value")
+ else if (!(other hasFlag DEFERRED) && other.owner.isTrait && (member hasFlag OVERRIDE))
+ overrideError("cannot override a value or variable definition in a trait " +
+ "\n (this is an implementation restriction)")
} else {
if (other.isAliasType) {
if (!member.typeParams.isEmpty) // (1.5)