diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-02 13:10:54 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-02 13:11:05 -0700 |
commit | 817da386e456be422861ac6e974838e6eb6db836 (patch) | |
tree | 121723c1684c7d2fb208730ab94dacf423563275 /test/files/pos/t6600.scala | |
parent | f8ed076e251ff8b6e2b1d27f8c8a0dde2117308d (diff) | |
download | scala-817da386e456be422861ac6e974838e6eb6db836.tar.gz scala-817da386e456be422861ac6e974838e6eb6db836.tar.bz2 scala-817da386e456be422861ac6e974838e6eb6db836.zip |
Fix for SI-6600, regression with ScalaNumber.
Not much in the end; I divided ScalaNumericConversions
into two traits such that the ScalaNumericAnyConversions can
be used in value classes, and ScalaNumericConversions can
override methods in ScalaNumber (since one trait cannot do
both those things.)
The fact that ScalaNumber is privileged for equality but a) extends
java.lang.Number and therefore b) cannot be a value class is something
we will want to revisit real soon.
Diffstat (limited to 'test/files/pos/t6600.scala')
-rw-r--r-- | test/files/pos/t6600.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/pos/t6600.scala b/test/files/pos/t6600.scala new file mode 100644 index 0000000000..1e8137894c --- /dev/null +++ b/test/files/pos/t6600.scala @@ -0,0 +1,8 @@ +final class Natural extends scala.math.ScalaNumber with scala.math.ScalaNumericConversions { + def intValue(): Int = 0 + def longValue(): Long = 0L + def floatValue(): Float = 0.0F + def doubleValue(): Double = 0.0D + def isWhole(): Boolean = false + def underlying() = this +} |