Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 30b56ed

Browse files
committedMar 5, 2015
AnyVal is not a derived value class
1 parent 23681e4 commit 30b56ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/dotty/tools/dotc/transform/ValueClasses.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import Flags._
1212
object ValueClasses {
1313

1414
def isDerivedValueClass(d: SymDenotation)(implicit ctx: Context) =
15-
d.isClass && d.derivesFrom(defn.AnyValClass) && !d.isPrimitiveValueClass
15+
d.isClass &&
16+
(d.symbol ne defn.AnyValClass) &&
17+
d.derivesFrom(defn.AnyValClass) &&
18+
!d.isPrimitiveValueClass
1619

1720
def isMethodWithExtension(d: SymDenotation)(implicit ctx: Context) =
1821
d.isSourceMethod &&

0 commit comments

Comments
 (0)
Please sign in to comment.