summaryrefslogtreecommitdiff
path: root/test/files/run/t3950.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-01-04 10:38:41 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-01-04 10:38:41 +0000
commita87d132bb752858dc5f8ac0d450a33f58dd12cba (patch)
tree32799c6c6515b752382f50d5ddf3b587e083f20f /test/files/run/t3950.scala
parent1f4d528702ca32ed01e500ea2ef2e9b2ebbe07d1 (diff)
downloadscala-a87d132bb752858dc5f8ac0d450a33f58dd12cba.tar.gz
scala-a87d132bb752858dc5f8ac0d450a33f58dd12cba.tar.bz2
scala-a87d132bb752858dc5f8ac0d450a33f58dd12cba.zip
Closes #3687, #3719, #3950, #3616.
Diffstat (limited to 'test/files/run/t3950.scala')
-rw-r--r--test/files/run/t3950.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t3950.scala b/test/files/run/t3950.scala
new file mode 100644
index 0000000000..fe99a7cc6f
--- /dev/null
+++ b/test/files/run/t3950.scala
@@ -0,0 +1,17 @@
+
+object NegativeId extends Enumeration {
+ val Negative = Value(-1, "minus")
+ val Zero = Value(0, "zero")
+ val Positive = Value(1, "plus")
+
+ def fromInt(id: Int) = values find (_.id == id) match {
+ case Some(v) => v
+ case None => null
+ }
+}
+
+object Test extends Application {
+ println(NegativeId.fromInt(-1))
+ println(NegativeId.fromInt(0))
+ println(NegativeId.fromInt(1))
+}