diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-31 07:37:01 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-31 07:37:01 -0800 |
commit | 42c4cc7a1eed222a1593c6ac2652cd5357c2897a (patch) | |
tree | fce2af644c22a08e35ca40c2d6b2a0dc7d29559d /test/files/run | |
parent | ba72ee7c6f556827a1e8100d9193f0452c5313a1 (diff) | |
parent | a87d40960bfdb4a683c05d3430a8874cb4dcff36 (diff) | |
download | scala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.tar.gz scala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.tar.bz2 scala-42c4cc7a1eed222a1593c6ac2652cd5357c2897a.zip |
Merge pull request #1989 from adriaanm/rework-pr-1945
SI-6968 Simple Tuple patterns aren't irrefutable
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t4574.scala | 13 | ||||
-rw-r--r-- | test/files/run/t6968.check | 1 | ||||
-rw-r--r-- | test/files/run/t6968.scala | 7 |
3 files changed, 8 insertions, 13 deletions
diff --git a/test/files/run/t4574.scala b/test/files/run/t4574.scala deleted file mode 100644 index 1dde496aca..0000000000 --- a/test/files/run/t4574.scala +++ /dev/null @@ -1,13 +0,0 @@ -object Test { - val xs: List[(Int, Int)] = List((2, 2), null) - - def expectMatchError[T](msg: String)(body: => T) { - try { body ; assert(false, "Should not succeed.") } - catch { case _: MatchError => println(msg) } - } - - def main(args: Array[String]): Unit = { - expectMatchError("I hereby refute null!")( for ((x, y) <- xs) yield x ) - expectMatchError("I denounce null as unListLike!")( (null: Any) match { case List(_*) => true } ) - } -} 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(", ")) + } +} |