summaryrefslogtreecommitdiff
path: root/test/files/run/t2111.scala
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-10-27 18:10:35 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-10-27 18:10:35 +0000
commit3a08cbbb97df78b056db97ab0898114d52ef2ead (patch)
tree458638d05a61fd3ec7ffba344d05a9c8a59c3f8f /test/files/run/t2111.scala
parent727490ab53bdda68b36a9e38a729471094c4e6b5 (diff)
downloadscala-3a08cbbb97df78b056db97ab0898114d52ef2ead.tar.gz
scala-3a08cbbb97df78b056db97ab0898114d52ef2ead.tar.bz2
scala-3a08cbbb97df78b056db97ab0898114d52ef2ead.zip
Improves Enumeration to obtain names of values ...
Improves Enumeration to obtain names of values through reflection. This addresses those parts of #2111 that we agreed on in the Scala meeting.
Diffstat (limited to 'test/files/run/t2111.scala')
-rw-r--r--test/files/run/t2111.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t2111.scala b/test/files/run/t2111.scala
new file mode 100644
index 0000000000..3c6c5b8e8f
--- /dev/null
+++ b/test/files/run/t2111.scala
@@ -0,0 +1,20 @@
+
+object Test extends Application {
+
+ object Color extends Enumeration {
+ val Red, Green, Blue = Value
+ }
+
+ class MyColor extends Enumeration {
+ val Red, Green, Blue = Value
+ }
+
+ println(Color.Red)
+ println(Color.Green)
+ println(Color.Blue)
+ val col = new MyColor
+ println(col.Blue)
+ println(col.Green)
+ println(col.Red)
+
+}