diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-02 13:43:52 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-02 13:43:52 +0200 |
commit | 0cdb29904affbf55d5f08a005e8b96acfd73aa81 (patch) | |
tree | 51945cb1f3f533cda72417127f48917f17cd5840 /tests/run | |
parent | 82f8a81e60fde5750301457d5f2319ee58038d40 (diff) | |
download | dotty-0cdb29904affbf55d5f08a005e8b96acfd73aa81.tar.gz dotty-0cdb29904affbf55d5f08a005e8b96acfd73aa81.tar.bz2 dotty-0cdb29904affbf55d5f08a005e8b96acfd73aa81.zip |
Fixed test.
Until the previous fix to Denotation-& the test here spuriously passed.
The Dotty spec is that value classes synthesize equals and hashCode only
if no concrete definitions are inherited except the ones from Any. That
was previously miscalculated.
The test has been updated to reflect the specified behavior.
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/t6534.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/run/t6534.scala b/tests/run/t6534.scala index 33df97e41..b5789f52c 100644 --- a/tests/run/t6534.scala +++ b/tests/run/t6534.scala @@ -8,7 +8,13 @@ object Test { def main(args: Array[String]): Unit = { val b1 = new Bippy1(71) val b2 = new Bippy2(71) - assert(b1 == b1 && b1.## == b1.x.##, ((b1, b1.##))) - assert(b2 == b2 && b2.## == b2.x.##, ((b2, b2.##))) + assert(b1 == b1) + assert(b1.## == b1.x.##, "hash differs1 " + ((b1, b1.##))) + assert(b2 == b2) + // assert(b2.## == b2.x.##, "hash differs2 " + ((b2, b2.##, b2.x.##))) + // Disabled, this does not hold. Because the value class inherits + // a different hashCode, no code is generated for it. Replaced by: + assert(b2.## == -1) + assert(!b1.equals(b1)) } } |