From ab3e6f21aebeb24075483fbefab48a13e65d48a4 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 1 Jul 2011 15:28:03 +0000 Subject: 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. --- test/files/run/bug4752.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/files/run/bug4752.scala (limited to 'test') 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) + } +} -- cgit v1.2.3