summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-06-30 22:57:41 +0000
committerPaul Phillips <paulp@improving.org>2010-06-30 22:57:41 +0000
commit12c8a6113e2a0de6669f850068d3b40fc2015bf6 (patch)
tree1b7238d680c1e4c3f3c18ff2a67ead7c68ec2753 /test/files/run
parent31dcef9d4cf7234fb3cbea4fd292432496a29ca8 (diff)
downloadscala-12c8a6113e2a0de6669f850068d3b40fc2015bf6.tar.gz
scala-12c8a6113e2a0de6669f850068d3b40fc2015bf6.tar.bz2
scala-12c8a6113e2a0de6669f850068d3b40fc2015bf6.zip
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.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/bug3616.check1
-rw-r--r--test/files/run/bug3616.scala12
2 files changed, 13 insertions, 0 deletions
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)
+ }
+}