From 12c8a6113e2a0de6669f850068d3b40fc2015bf6 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 30 Jun 2010 22:57:41 +0000 Subject: Enumeration fixes. correctly simply by inspecting method signatures (because a Value from a different Enumeration stored in a val looks identical to one from this Enumeration) so I have Value store the outer Enum for comparison purposes. This won't make anything new uncollectable because they already have an $outer pointing there. This also simplified the reflection logic: it's an eq test rather than a series of heuristics. Closes #3616, #3615. Review by phaller. --- test/files/run/bug3616.check | 1 + test/files/run/bug3616.scala | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/files/run/bug3616.check create mode 100644 test/files/run/bug3616.scala (limited to 'test/files/run') diff --git a/test/files/run/bug3616.check b/test/files/run/bug3616.check new file mode 100644 index 0000000000..f31e21baff --- /dev/null +++ b/test/files/run/bug3616.check @@ -0,0 +1 @@ +Fruit.ValueSet(A, B, C) diff --git a/test/files/run/bug3616.scala b/test/files/run/bug3616.scala new file mode 100644 index 0000000000..777b97f9ab --- /dev/null +++ b/test/files/run/bug3616.scala @@ -0,0 +1,12 @@ +object X extends Enumeration { + val Y = Value +} +object Fruit extends Enumeration { + val x = X.Y + val A,B,C = Value +} +object Test { + def main(args: Array[String]): Unit = { + println(Fruit.values) + } +} -- cgit v1.2.3