diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/trailing-commas.scala | 4 | ||||
-rw-r--r-- | test/files/run/trailing-commas.check | 9 | ||||
-rw-r--r-- | test/files/run/trailing-commas.scala | 7 |
3 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/trailing-commas.scala b/test/files/pos/trailing-commas.scala index 52273b4dbd..b9401fe49d 100644 --- a/test/files/pos/trailing-commas.scala +++ b/test/files/pos/trailing-commas.scala @@ -123,6 +123,10 @@ trait SimplePattern { case List(1, 2, _ @ _*, ) => 1 } + + // test varargs in patterns + val List(x, y, _*, + ) = 42 :: 17 :: Nil } trait ImportSelectors { diff --git a/test/files/run/trailing-commas.check b/test/files/run/trailing-commas.check new file mode 100644 index 0000000000..0dc4335ccd --- /dev/null +++ b/test/files/run/trailing-commas.check @@ -0,0 +1,9 @@ + +scala> // test varargs in patterns + +scala> val List(x, y, _*, +) = 42 :: 17 :: Nil +x: Int = 42 +y: Int = 17 + +scala> :quit diff --git a/test/files/run/trailing-commas.scala b/test/files/run/trailing-commas.scala new file mode 100644 index 0000000000..6a7f1bb55f --- /dev/null +++ b/test/files/run/trailing-commas.scala @@ -0,0 +1,7 @@ +object Test extends scala.tools.partest.ReplTest { + def code = """ +// test varargs in patterns +val List(x, y, _*, +) = 42 :: 17 :: Nil +""" +} |