summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-08-28 10:41:23 -0700
committerPaul Phillips <paulp@improving.org>2012-08-28 16:09:00 -0700
commit3cff2587d78eb6023ab1a584eba1bba8fd3660a0 (patch)
tree638deeaadc68eae24365858a0ae267a978422fc1 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parent8ca87e36baaf2b834fe49610180a4e6c3d7b7fa0 (diff)
downloadscala-3cff2587d78eb6023ab1a584eba1bba8fd3660a0.tar.gz
scala-3cff2587d78eb6023ab1a584eba1bba8fd3660a0.tar.bz2
scala-3cff2587d78eb6023ab1a584eba1bba8fd3660a0.zip
Fix for SI-6283, no abstract value classes.
The needless abstraction penalty was in full flower in Namers. I managed to find somewhere else to issue this error, where I can still just write an error message without tracking down an enumeration in a separate file and inventing an intermediate name for the enum member.
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, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 9201981635..166bb2d18c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -1618,6 +1618,8 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
if ((clazz isSubClass AnyValClass) && !isPrimitiveValueClass(clazz)) {
if (clazz.isTrait)
unit.error(clazz.pos, "Only classes (not traits) are allowed to extend AnyVal")
+ else if ((clazz != AnyValClass) && clazz.hasFlag(ABSTRACT))
+ unit.error(clazz.pos, "`abstract' modifier cannot be used with value classes")
}
}