aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t4482.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t4482.scala')
-rw-r--r--tests/run/t4482.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run/t4482.scala b/tests/run/t4482.scala
new file mode 100644
index 000000000..392861c22
--- /dev/null
+++ b/tests/run/t4482.scala
@@ -0,0 +1,15 @@
+trait Foo { def i: Int }
+trait Bar
+
+case class Spam(i: Int) extends Foo with Bar
+
+object Test {
+ def matchParent(p:Any) = p match {
+ case f:Foo if f.i == 1 => 1
+ case _:Bar => 2
+ case _:Foo => 3
+ }
+ def main(args: Array[String]): Unit = {
+ println(matchParent(Spam(3)))
+ }
+}