diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug1878.check | 7 | ||||
-rw-r--r-- | test/files/neg/bug1878.scala | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/bug1878.check b/test/files/neg/bug1878.check new file mode 100644 index 0000000000..7b25a909a2 --- /dev/null +++ b/test/files/neg/bug1878.check @@ -0,0 +1,7 @@ +bug1878.scala:3: error: _* may only come last + val err1 = "" match { case Seq(f @ _*, ',') => f } + ^ +bug1878.scala:9: error: _* may only come last + val List(List(_*, arg2), _) = List(List(1,2,3), List(4,5,6)) + ^ +two errors found diff --git a/test/files/neg/bug1878.scala b/test/files/neg/bug1878.scala new file mode 100644 index 0000000000..ca76df082b --- /dev/null +++ b/test/files/neg/bug1878.scala @@ -0,0 +1,10 @@ +object Test extends Application { + // illegal + val err1 = "" match { case Seq(f @ _*, ',') => f } + + // no error + val List(List(arg1, _*), _) = List(List(1,2,3), List(4,5,6)) + + // illegal + val List(List(_*, arg2), _) = List(List(1,2,3), List(4,5,6)) +}
\ No newline at end of file |