aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-05-26 20:50:28 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-05-27 16:41:37 +0200
commit8f08b714424b3ada8a12156bdc3fd43e13ad09ee (patch)
tree2d874cd0d7f2775e8d6ce1a67b954d3601f5beac /tests
parent87b779bc96e10adc6a05635393cecc9ecbb2b4ea (diff)
downloaddotty-8f08b714424b3ada8a12156bdc3fd43e13ad09ee.tar.gz
dotty-8f08b714424b3ada8a12156bdc3fd43e13ad09ee.tar.bz2
dotty-8f08b714424b3ada8a12156bdc3fd43e13ad09ee.zip
Annotate repeated params with `case` flag to indicate that they are legal
One drawback with this approach is that the type seems to propagate. I.e. if the return type of an expression is `repeated` then the enclosing variable will get the `repeated` type instead of getting the expected `Seq` type
Diffstat (limited to 'tests')
-rw-r--r--tests/disabled/pos/t3480.scala2
-rw-r--r--tests/pos/vararg-pattern.scala5
2 files changed, 2 insertions, 5 deletions
diff --git a/tests/disabled/pos/t3480.scala b/tests/disabled/pos/t3480.scala
index ba2e1a4b8..55dde6634 100644
--- a/tests/disabled/pos/t3480.scala
+++ b/tests/disabled/pos/t3480.scala
@@ -1,4 +1,4 @@
object Test {
val List(_: _*) = List(1)
- val Array( who, what : _* ) = "Eclipse plugin cannot not handle this" split (" ")
+ val Array(who, what: _*) = "Eclipse plugin cannot not handle this" split (" ")
}
diff --git a/tests/pos/vararg-pattern.scala b/tests/pos/vararg-pattern.scala
index 314d6460f..430973a28 100644
--- a/tests/pos/vararg-pattern.scala
+++ b/tests/pos/vararg-pattern.scala
@@ -1,12 +1,9 @@
object Test {
-
List(1, 2, 3, 4) match {
case List(1, 2, xs: _*) =>
val ys: Seq[Int] = xs
println(ys)
}
- val List(1, 2, x: _*) = List(1, 2, 3, 4)
+ val List(1, 2, x: _*) = List(1, 2, 3, 4)
}
-
-