aboutsummaryrefslogtreecommitdiff
path: root/tests/pos-scala2
diff options
context:
space:
mode:
authorliu fengyun <liufengyunchina@gmail.com>2016-03-15 17:47:39 +0100
committerliu fengyun <liufengyunchina@gmail.com>2016-03-18 15:08:51 +0100
commit72b44d9b5df579e90b5aba5c55d04f6b34081d02 (patch)
treef4ae237bfee63c57131bd6a53760c10d6acbe8ea /tests/pos-scala2
parentf8ebf777b92e858a7ff8cfdf022e151b4f056920 (diff)
downloaddotty-72b44d9b5df579e90b5aba5c55d04f6b34081d02.tar.gz
dotty-72b44d9b5df579e90b5aba5c55d04f6b34081d02.tar.bz2
dotty-72b44d9b5df579e90b5aba5c55d04f6b34081d02.zip
support `xs @ _*` and `_*` in Scala2 mode
The standard syntax in Dotty now is `xs : _*`. In Scala2 mode, following code should be valid: list match { case List(_, _, _, _ @ _*) => 0 case List(_, _, _*) => 1 case List(_, _: _*) => 2 case Nil => 3 }
Diffstat (limited to 'tests/pos-scala2')
-rw-r--r--tests/pos-scala2/i1059.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pos-scala2/i1059.scala b/tests/pos-scala2/i1059.scala
new file mode 100644
index 000000000..cd23e1916
--- /dev/null
+++ b/tests/pos-scala2/i1059.scala
@@ -0,0 +1,10 @@
+object Repeated {
+ val list = List(1, 2, 3)
+
+ list match {
+ case List(_, _, _, _ @ _*) => 0
+ case List(_, _, _*) => 1
+ case List(_, _: _*) => 2
+ case Nil => 3
+ }
+}