diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-19 15:06:00 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-19 16:48:50 +0200 |
commit | d3819ce631310baab00c44a0d1845b267d60bcdd (patch) | |
tree | 0465fd4875e4e61366d3f719c64e498562f3bc80 /tests/pending/run | |
parent | b71650f367a97536a2fbb6ecaae0e046651ae9f5 (diff) | |
download | dotty-d3819ce631310baab00c44a0d1845b267d60bcdd.tar.gz dotty-d3819ce631310baab00c44a0d1845b267d60bcdd.tar.bz2 dotty-d3819ce631310baab00c44a0d1845b267d60bcdd.zip |
Enable t5629b.
Was also fixed in this PR.
Diffstat (limited to 'tests/pending/run')
-rw-r--r-- | tests/pending/run/t5629b.check | 10 | ||||
-rw-r--r-- | tests/pending/run/t5629b.scala | 36 |
2 files changed, 0 insertions, 46 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") - -} |