summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-01-13 17:42:48 +0100
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-01-27 22:42:02 -0800
commita87d40960bfdb4a683c05d3430a8874cb4dcff36 (patch)
treea65ddd00ebdee081055d982f6408cbfc34e9e62c /test
parent02963d724c512251ce66502226408091686989ee (diff)
downloadscala-a87d40960bfdb4a683c05d3430a8874cb4dcff36.tar.gz
scala-a87d40960bfdb4a683c05d3430a8874cb4dcff36.tar.bz2
scala-a87d40960bfdb4a683c05d3430a8874cb4dcff36.zip
SI-6968 Simple Tuple patterns aren't irrefutable
Reverts part of c82ecab. The parser can't assume that a pattern `(a, b)` will match, as results of `.isInstanceOf[Tuple2]` can't be statically known until after the typer. The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing this regression SI-6968. Keeping all of those fixed will require a better definition of irrefutability, and some acrobatics to ensure safe passage to the ambiguous trees through typechecking.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6968.check1
-rw-r--r--test/files/run/t6968.scala7
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala2
-rw-r--r--test/pending/neg/t5589neg.check (renamed from test/files/neg/t5589neg.check)0
-rw-r--r--test/pending/neg/t5589neg.scala (renamed from test/files/neg/t5589neg.scala)0
-rw-r--r--test/pending/neg/t5589neg2.scala (renamed from test/files/neg/t5589neg2.scala)0
-rw-r--r--test/pending/pos/t1336.scala (renamed from test/files/pos/t1336.scala)0
-rw-r--r--test/pending/pos/t5589.scala (renamed from test/files/pos/t5589.scala)0
-rw-r--r--test/pending/run/t4574.scala (renamed from test/files/run/t4574.scala)0
9 files changed, 9 insertions, 1 deletions
diff --git a/test/files/run/t6968.check b/test/files/run/t6968.check
new file mode 100644
index 0000000000..7a18941537
--- /dev/null
+++ b/test/files/run/t6968.check
@@ -0,0 +1 @@
+1, 3, 5
diff --git a/test/files/run/t6968.scala b/test/files/run/t6968.scala
new file mode 100644
index 0000000000..b5cadfd9e1
--- /dev/null
+++ b/test/files/run/t6968.scala
@@ -0,0 +1,7 @@
+object Test {
+ def main(args: Array[String]) {
+ val mixedList = List(1,(1,2),4,(3,1),(5,4),6)
+ val as = for((a,b) <- mixedList) yield a
+ println(as.mkString(", "))
+ }
+}
diff --git a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
index 05237bace8..b6af8f41bd 100644
--- a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
+++ b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
@@ -20,7 +20,7 @@ abstract class ParallelMapCheck[K, V](collname: String) extends ParallelIterable
property("gets iterated keys") = forAll(collectionPairs) {
case (t, coll) =>
val containsT = for ((k, v) <- t) yield (coll.get(k) == Some(v))
- val containsSelf = for ((k, v) <- coll) yield (coll.get(k) == Some(v))
+ val containsSelf = coll.map { case (k, v) => coll.get(k) == Some(v) }
("Par contains elements of seq map" |: containsT.forall(_ == true)) &&
("Par contains elements of itself" |: containsSelf.forall(_ == true))
}
diff --git a/test/files/neg/t5589neg.check b/test/pending/neg/t5589neg.check
index f1dad94df3..f1dad94df3 100644
--- a/test/files/neg/t5589neg.check
+++ b/test/pending/neg/t5589neg.check
diff --git a/test/files/neg/t5589neg.scala b/test/pending/neg/t5589neg.scala
index 31ff2c3693..31ff2c3693 100644
--- a/test/files/neg/t5589neg.scala
+++ b/test/pending/neg/t5589neg.scala
diff --git a/test/files/neg/t5589neg2.scala b/test/pending/neg/t5589neg2.scala
index b7c7ab7218..b7c7ab7218 100644
--- a/test/files/neg/t5589neg2.scala
+++ b/test/pending/neg/t5589neg2.scala
diff --git a/test/files/pos/t1336.scala b/test/pending/pos/t1336.scala
index 63967985c7..63967985c7 100644
--- a/test/files/pos/t1336.scala
+++ b/test/pending/pos/t1336.scala
diff --git a/test/files/pos/t5589.scala b/test/pending/pos/t5589.scala
index 69cbb20391..69cbb20391 100644
--- a/test/files/pos/t5589.scala
+++ b/test/pending/pos/t5589.scala
diff --git a/test/files/run/t4574.scala b/test/pending/run/t4574.scala
index 1dde496aca..1dde496aca 100644
--- a/test/files/run/t4574.scala
+++ b/test/pending/run/t4574.scala