diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bug508.check | 3 | ||||
-rw-r--r-- | test/files/run/bug508.scala | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/bug508.check b/test/files/run/bug508.check new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/test/files/run/bug508.check @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/test/files/run/bug508.scala b/test/files/run/bug508.scala new file mode 100644 index 0000000000..80485371ea --- /dev/null +++ b/test/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) + } +} |