diff options
author | odersky <odersky@gmail.com> | 2015-06-19 18:44:41 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-06-19 18:44:41 +0200 |
commit | bb75d4039ee127dfee2630609924f7f3c9132ff6 (patch) | |
tree | 2cfb328fd518fe70fc9d025f33bdbe0e5ea229ad /tests/pending/run | |
parent | ad6c4ad920bfed6c7c9a87850f51433260a2acf5 (diff) | |
parent | d3819ce631310baab00c44a0d1845b267d60bcdd (diff) | |
download | dotty-bb75d4039ee127dfee2630609924f7f3c9132ff6.tar.gz dotty-bb75d4039ee127dfee2630609924f7f3c9132ff6.tar.bz2 dotty-bb75d4039ee127dfee2630609924f7f3c9132ff6.zip |
Merge pull request #669 from dotty-staging/fix-patmat-seq
Fix sequence matching.
Diffstat (limited to 'tests/pending/run')
-rw-r--r-- | tests/pending/run/t5629b.check | 10 | ||||
-rw-r--r-- | tests/pending/run/t5629b.scala | 36 | ||||
-rw-r--r-- | tests/pending/run/t889.check | 1 | ||||
-rw-r--r-- | tests/pending/run/t889.scala | 9 |
4 files changed, 0 insertions, 56 deletions
diff --git a/tests/pending/run/t5629b.check b/tests/pending/run/t5629b.check deleted file mode 100644 index e0f25f0b0..000000000 --- a/tests/pending/run/t5629b.check +++ /dev/null @@ -1,10 +0,0 @@ -=== pf(1): -MySmartPF.apply entered... -newPF.applyOrElse entered... -default -scala.MatchError: 1 (of class java.lang.Integer) -=== pf(42): -MySmartPF.apply entered... -newPF.applyOrElse entered... -ok -=== done diff --git a/tests/pending/run/t5629b.scala b/tests/pending/run/t5629b.scala deleted file mode 100644 index 9cee18893..000000000 --- a/tests/pending/run/t5629b.scala +++ /dev/null @@ -1,36 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - - trait MyPF[@specialized(Int) -A] extends (A => Unit) { - def isDefinedAt(x: A): Boolean - def applyOrElse[A1 <: A](x: A1, default: A1 => Unit): Unit = { - println("MyPF.applyOrElse entered...") - if (isDefinedAt(x)) apply(x) else default(x) - } - } - - trait MySmartPF[@specialized(Int) -A] extends MyPF[A] { - def apply(x: A): Unit = { - println("MySmartPF.apply entered...") - applyOrElse(x, { default: Any => throw new MatchError(default) }) - } - } - - type T = Int - //type T = Any - - def newPF(test: T): MyPF[T] = new MySmartPF[T] { - def isDefinedAt(x: T): Boolean = x != test - override def applyOrElse[A1 <: T](x: A1, default: A1 => Unit): Unit = { - println("newPF.applyOrElse entered...") - if (x != test) { println("ok"); () } else { println("default"); default(x) } - } - } - - val pf = newPF(1) - println("=== pf(1):") - try { pf(1) } catch { case x: Throwable => println(x) } - println("=== pf(42):") - pf(42) - println("=== done") - -} diff --git a/tests/pending/run/t889.check b/tests/pending/run/t889.check deleted file mode 100644 index 67ca2bf46..000000000 --- a/tests/pending/run/t889.check +++ /dev/null @@ -1 +0,0 @@ -first: a, rest: List() diff --git a/tests/pending/run/t889.scala b/tests/pending/run/t889.scala deleted file mode 100644 index 8e5d82412..000000000 --- a/tests/pending/run/t889.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test extends dotty.runtime.LegacyApp { - - val a = List("a") - - a match { - case Seq("a", "b", rest : _*) => println("a, b, " + rest) - case Seq(first, rest : _*) => println("first: " + first + ", rest: " + rest) - } -} |