diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-10 21:04:36 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-10 21:04:36 +0000 |
commit | 9f9932bd20250d243d2df04d8b42417a896dc987 (patch) | |
tree | ddd11bf872dfc29907eaa57c71bfe5debbc6e169 /src | |
parent | a38f03ba966907c2996944bf1e82f51760c661d9 (diff) | |
download | scala-9f9932bd20250d243d2df04d8b42417a896dc987.tar.gz scala-9f9932bd20250d243d2df04d8b42417a896dc987.tar.bz2 scala-9f9932bd20250d243d2df04d8b42417a896dc987.zip |
Fix for regression in overriding with defaults.
I should know better than to behave as if usable inferences can be drawn
from a comment like "SYNTHETIC because of DEVIRTUALIZE". Maybe it was
even true when it was written, but no more. Closes SI-5178, no review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index c3c353385c..1c4355b3bd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -364,7 +364,8 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R overrideError("cannot be used here - classes can only override abstract types"); } else if (other.isFinal) { // (1.2) overrideError("cannot override final member"); - } else if (!other.isDeferred && !member.isAnyOverride) { + // synthetic exclusion needed for (at least) default getters. + } else if (!other.isDeferred && !member.isAnyOverride && !member.isSynthetic) { overrideError("needs `override' modifier"); } else if (other.isAbstractOverride && other.isIncompleteIn(clazz) && !member.isAbstractOverride) { overrideError("needs `abstract override' modifiers") |