summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-05-12 07:15:40 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-05-12 07:20:08 +0200
commit3a7a92bd9263a932c5a3f64307641b374923580a (patch)
tree00532a38cbe96f66a2c76954deffaee0e566536d
parent3511e5960d510eafcb67c388ec0b5b60aafdd8f3 (diff)
downloadscala-3a7a92bd9263a932c5a3f64307641b374923580a.tar.gz
scala-3a7a92bd9263a932c5a3f64307641b374923580a.tar.bz2
scala-3a7a92bd9263a932c5a3f64307641b374923580a.zip
Test case closes SI-4124.
This looks like a job for... virtpatmat!
-rw-r--r--test/files/run/t4124.check4
-rw-r--r--test/files/run/t4124.scala24
2 files changed, 28 insertions, 0 deletions
diff --git a/test/files/run/t4124.check b/test/files/run/t4124.check
new file mode 100644
index 0000000000..66a0092d93
--- /dev/null
+++ b/test/files/run/t4124.check
@@ -0,0 +1,4 @@
+hi
+hi
+bye
+bye
diff --git a/test/files/run/t4124.scala b/test/files/run/t4124.scala
new file mode 100644
index 0000000000..9f35b57ce3
--- /dev/null
+++ b/test/files/run/t4124.scala
@@ -0,0 +1,24 @@
+import xml.Node
+
+object Test extends App {
+ val body: Node = <elem>hi</elem>
+ println ((body: AnyRef, "foo") match {
+ case (node: Node, "bar") => "bye"
+ case (ser: Serializable, "foo") => "hi"
+ })
+
+ println ((body, "foo") match {
+ case (node: Node, "bar") => "bye"
+ case (ser: Serializable, "foo") => "hi"
+ })
+
+ println ((body: AnyRef, "foo") match {
+ case (node: Node, "foo") => "bye"
+ case (ser: Serializable, "foo") => "hi"
+ })
+
+ println ((body: AnyRef, "foo") match {
+ case (node: Node, "foo") => "bye"
+ case (ser: Serializable, "foo") => "hi"
+ })
+}