diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-18 09:01:51 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-18 09:01:51 -0700 |
commit | c5fdc815c30f0565a80a3837f368717a4e81e04d (patch) | |
tree | 48d2fc9de28b359fa9ef479e78388b9778f4ef52 /test/files/run/t5629b.scala | |
parent | 42151a9980be37eae6e8fdf40330070361fd88fd (diff) | |
parent | f4267ccd96a9143c910c66a5b0436aaa64b7c9dc (diff) | |
download | scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.tar.gz scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.tar.bz2 scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.zip |
Merge pull request #2961 from paulp/pr/whitespace
Cull extraneous whitespace.
Diffstat (limited to 'test/files/run/t5629b.scala')
-rw-r--r-- | test/files/run/t5629b.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/files/run/t5629b.scala b/test/files/run/t5629b.scala index adb9ca5498..9ff29c8d89 100644 --- a/test/files/run/t5629b.scala +++ b/test/files/run/t5629b.scala @@ -4,7 +4,7 @@ object Test extends App { - + trait MyPF[@specialized(Int) -A] extends (A => Unit) { def isDefinedAt(x: A): Boolean def applyOrElse[A1 <: A](x: A1, default: A1 => Unit): Unit = { @@ -12,30 +12,30 @@ object Test extends App { 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, { _: Any => throw new MatchError }) } } - + 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) } + 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") - + } |