summaryrefslogtreecommitdiff
path: root/test/files/pos/t8044.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t8044.scala')
-rw-r--r--test/files/pos/t8044.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/pos/t8044.scala b/test/files/pos/t8044.scala
new file mode 100644
index 0000000000..2519a8306b
--- /dev/null
+++ b/test/files/pos/t8044.scala
@@ -0,0 +1,15 @@
+
+trait T {
+ def f = 42 match { case `x` @ _ => x }
+ def g = 42 match { case `type` @ _ => `type` }
+ def h = 42 match { case `type` : Int => `type` }
+ def i = (null: Any) match { case _: Int | _: String => 17 }
+
+ // arbitrary idents allowed in @ syntax
+ def j = "Fred" match { case Name @ (_: String) => Name }
+ def k = "Fred" match { case * @ (_: String) => * }
+
+ // also in sequence pattern
+ def m = List(1,2,3,4,5) match { case List(1, `Rest of them` @ _*) => `Rest of them` }
+
+}