diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t8044.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/pos/t8044.scala b/test/files/pos/t8044.scala index 8259f06a8a..2519a8306b 100644 --- a/test/files/pos/t8044.scala +++ b/test/files/pos/t8044.scala @@ -4,4 +4,12 @@ trait T { 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` } + } |