Browse files

Simplify some checks in Refchecks.

Same result, simpler expression.
  • Loading branch information...
1 parent cf93e02 commit 9a3bd6c4d3def5dec5c31fda508573088c36ab0a @paulp paulp committed Apr 23, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
View
4 src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -1511,10 +1511,10 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
// Verify classes extending AnyVal meet the requirements
private def checkAnyValSubclass(clazz: Symbol) = {
- if ((clazz isSubClass AnyValClass) && !isPrimitiveValueClass(clazz)) {
+ if (clazz.isDerivedValueClass) {
if (clazz.isTrait)
unit.error(clazz.pos, "Only classes (not traits) are allowed to extend AnyVal")
- else if ((clazz != AnyValClass) && clazz.hasFlag(ABSTRACT))
+ else if (clazz.hasAbstractFlag)
unit.error(clazz.pos, "`abstract' modifier cannot be used with value classes")
}
}

0 comments on commit 9a3bd6c

Please sign in to comment.