summaryrefslogtreecommitdiff
path: root/test/files/run/bug4752.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-01 15:28:03 +0000
committerPaul Phillips <paulp@improving.org>2011-07-01 15:28:03 +0000
commitab3e6f21aebeb24075483fbefab48a13e65d48a4 (patch)
treef87501c307951fd46b046c3ddf65cc240c65914a /test/files/run/bug4752.scala
parent3c5f893b78e5cfc7d0124cece34daea257e649ff (diff)
downloadscala-ab3e6f21aebeb24075483fbefab48a13e65d48a4.tar.gz
scala-ab3e6f21aebeb24075483fbefab48a13e65d48a4.tar.bz2
scala-ab3e6f21aebeb24075483fbefab48a13e65d48a4.zip
Stable hashCodes for case objects.
Somehow case objects fell through the cracks and have had default hashCode implementations, leading to new hashCodes on each jvm run. Now we use the productPrefix, and inline it right into the bytecode. scala> None.## == "None".## res0: Boolean = true Closes #4752, no review.
Diffstat (limited to 'test/files/run/bug4752.scala')
-rw-r--r--test/files/run/bug4752.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/bug4752.scala b/test/files/run/bug4752.scala
new file mode 100644
index 0000000000..3d5c166a7a
--- /dev/null
+++ b/test/files/run/bug4752.scala
@@ -0,0 +1,10 @@
+object Test {
+ object Bippy {
+ case object Dingus
+ }
+
+ def main(args: Array[String]): Unit = {
+ assert(None.## == "None".##, None)
+ assert(Test.Bippy.Dingus.## == "Dingus".##, Test.Bippy.Dingus)
+ }
+}