summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-07-06 16:11:32 -0700
committerAdriaan Moors <adriaan@lightbend.com>2016-08-11 10:59:16 -0700
commit9b59f5f9530d54c917479c6bf44aa3007ba0a2df (patch)
tree5e31b6c4c8281e0f51b8f8cf7dcfd6b611a9f612 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parent16e7cf335bf9fbd7f68b043b9d670336c6897809 (diff)
downloadscala-9b59f5f9530d54c917479c6bf44aa3007ba0a2df.tar.gz
scala-9b59f5f9530d54c917479c6bf44aa3007ba0a2df.tar.bz2
scala-9b59f5f9530d54c917479c6bf44aa3007ba0a2df.zip
Allow 'overriding' deferred var
Discovered by scala-js's test suite.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 7021e12f1a..674e0051b4 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -433,7 +433,7 @@ abstract class RefChecks extends Transform {
} else if (other.isAbstractOverride && other.isIncompleteIn(clazz) && !member.isAbstractOverride) {
overrideError("needs `abstract override' modifiers")
}
- else if (member.isAnyOverride && (other hasFlag ACCESSOR) && !(other hasFlag STABLE)) {
+ else if (member.isAnyOverride && (other hasFlag ACCESSOR) && !(other hasFlag STABLE | DEFERRED)) {
// The check above used to look at `field` == `other.accessed`, ensuring field.isVariable && !field.isLazy,
// which I think is identical to the more direct `!(other hasFlag STABLE)` (given that `other` is a method).
// Also, we're moving away from (looking at) underlying fields (vals in traits no longer have them, to begin with)