diff options
author | michelou <michelou@epfl.ch> | 2005-12-13 18:12:15 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2005-12-13 18:12:15 +0000 |
commit | 9b60de91bad101d313d45a903cd39e3fbe073561 (patch) | |
tree | 5f7ee76911ef21f4e659890cfcc3061635590054 /test-nsc/files/run | |
parent | 3c7879dea0a7f8d4928087a1e8434d8c23bf6a64 (diff) | |
download | scala-9b60de91bad101d313d45a903cd39e3fbe073561.tar.gz scala-9b60de91bad101d313d45a903cd39e3fbe073561.tar.bz2 scala-9b60de91bad101d313d45a903cd39e3fbe073561.zip |
*** empty log message ***
Diffstat (limited to 'test-nsc/files/run')
-rw-r--r-- | test-nsc/files/run/bug508.check | 3 | ||||
-rw-r--r-- | test-nsc/files/run/bug508.scala | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test-nsc/files/run/bug508.check b/test-nsc/files/run/bug508.check new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/test-nsc/files/run/bug508.check @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/test-nsc/files/run/bug508.scala b/test-nsc/files/run/bug508.scala new file mode 100644 index 0000000000..80485371ea --- /dev/null +++ b/test-nsc/files/run/bug508.scala @@ -0,0 +1,20 @@ +object Test { + case class Operator(x: Int); + val EQ = new Operator(2); + + def main(args: Array[String]): Unit = { + val x = Pair(EQ, 0); + analyze(x); // should print "0" + val y = Pair(EQ, 1); + analyze(y); // should print "1" + val z = Pair(EQ, 2); + analyze(z); // should print "2" + } + + def analyze(x: Pair[Operator, Int]) = x match { + case Pair(EQ, 0) => Console.println("0") + case Pair(EQ, 1) => Console.println("1") + case Pair(EQ, 2) => Console.println("2") + case _ => Console.println("undefined on " + x) + } +} |