summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)