summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-22 19:34:12 +0000
committerPaul Phillips <paulp@improving.org>2011-09-22 19:34:12 +0000
commit7e47107efa5d0eea79731d7f73a3b624b9cb1601 (patch)
treead2c8d0f913e0ac188a7dd2c0d0775512abfaecf /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parentafe1d6fa6293465b8f97d2ca4699640fe4d09bad (diff)
downloadscala-7e47107efa5d0eea79731d7f73a3b624b9cb1601.tar.gz
scala-7e47107efa5d0eea79731d7f73a3b624b9cb1601.tar.bz2
scala-7e47107efa5d0eea79731d7f73a3b624b9cb1601.zip
Removed devirtualize.
It was time. Removed unused flags and devirtualize detritus. Cleaned up flags a bit further. Fixed the contents of phaseNewFlags in those places where it was inaccurate. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index e2fb367d20..fda6a6f12e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -249,9 +249,6 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
}
}
- def isAbstractTypeWithoutFBound(sym: Symbol) = // (part of DEVIRTUALIZE)
- sym.isAbstractType && !sym.isFBounded
-
def infoString(sym: Symbol) = infoString0(sym, sym.owner != clazz)
def infoStringWithLocation(sym: Symbol) = infoString0(sym, true)
@@ -371,14 +368,13 @@ 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 hasFlag (OVERRIDE | ABSOVERRIDE | SYNTHETIC))) { // (1.3), SYNTHETIC because of DEVIRTUALIZE
+ } else if (!other.isDeferred && !member.isAnyOverride) {
overrideError("needs `override' modifier");
- } else if ((other hasFlag ABSOVERRIDE) && other.isIncompleteIn(clazz) && !(member hasFlag ABSOVERRIDE)) {
+ } else if (other.isAbstractOverride && other.isIncompleteIn(clazz) && !member.isAbstractOverride) {
overrideError("needs `abstract override' modifiers")
- } else if ((member hasFlag (OVERRIDE | ABSOVERRIDE)) &&
- (other hasFlag ACCESSOR) && other.accessed.isVariable && !other.accessed.isLazy) {
+ } else if (member.isAnyOverride && (other hasFlag ACCESSOR) && other.accessed.isVariable && !other.accessed.isLazy) {
overrideError("cannot override a mutable variable")
- } else if ((member hasFlag (OVERRIDE | ABSOVERRIDE)) &&
+ } else if (member.isAnyOverride &&
!(member.owner.thisType.baseClasses exists (_ isSubClass other.owner)) &&
!member.isDeferred && !other.isDeferred &&
intersectionIsEmpty(member.extendedOverriddenSymbols, other.extendedOverriddenSymbols)) {
@@ -386,11 +382,11 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
"(this rule is designed to prevent ``accidental overrides'')")
} else if (other.isStable && !member.isStable) { // (1.4)
overrideError("needs to be a stable, immutable value")
- } else if (member.isValue && (member hasFlag LAZY) &&
- other.isValue && !other.isSourceMethod && !other.isDeferred && !(other hasFlag LAZY)) {
+ } else if (member.isValue && member.isLazy &&
+ other.isValue && !other.isSourceMethod && !other.isDeferred && !other.isLazy) {
overrideError("cannot override a concrete non-lazy value")
- } else if (other.isValue && (other hasFlag LAZY) && !other.isSourceMethod && !other.isDeferred &&
- member.isValue && !(member hasFlag LAZY)) {
+ } else if (other.isValue && other.isLazy && !other.isSourceMethod && !other.isDeferred &&
+ member.isValue && !member.isLazy) {
overrideError("must be declared lazy to override a concrete lazy value")
} else {
checkOverrideTypes()