diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-12-19 04:23:15 -0800 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-12-19 04:23:15 -0800 |
commit | a86730d545d7afd6836755f90f5eb9d2443e70d2 (patch) | |
tree | 883d7c5e3678064a95a2a2c282152b2f00aed04d /src/test/scala/scala/async/TreeInterrogation.scala | |
parent | 933657d7541bc54b9f03d86d215d274f83694b31 (diff) | |
parent | 1359c3cd1750a95260bcc9d0dcbe56ef10c35d68 (diff) | |
download | scala-async-a86730d545d7afd6836755f90f5eb9d2443e70d2.tar.gz scala-async-a86730d545d7afd6836755f90f5eb9d2443e70d2.tar.bz2 scala-async-a86730d545d7afd6836755f90f5eb9d2443e70d2.zip |
Merge pull request #49 from phaller/topic/patmat-partial-function
Topic/patmat partial function
Diffstat (limited to 'src/test/scala/scala/async/TreeInterrogation.scala')
-rw-r--r-- | src/test/scala/scala/async/TreeInterrogation.scala | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/test/scala/scala/async/TreeInterrogation.scala b/src/test/scala/scala/async/TreeInterrogation.scala index b22faa9..93cfdf5 100644 --- a/src/test/scala/scala/async/TreeInterrogation.scala +++ b/src/test/scala/scala/async/TreeInterrogation.scala @@ -62,23 +62,21 @@ object TreeInterrogation extends App { val levels = Seq("trace", "debug") def setAll(value: Boolean) = levels.foreach(set(_, value)) - setAll(true) - try t finally setAll(false) + setAll(value = true) + try t finally setAll(value = false) } withDebug { val cm = reflect.runtime.currentMirror - val tb = mkToolbox("-cp target/scala-2.10/classes -Xprint:all") + val tb = mkToolbox("-cp target/scala-2.10/classes -Xprint:flatten") val tree = tb.parse( """ import scala.async.AsyncId.{async, await} - | def foo(a: Int, b: Int) = (a, b) - | val result = async { - | var i = 0 - | def next() = { - | i += 1; - | i - | } - | foo(next(), await(next())) + | async { + | await(1) + | val neg1 = -1 + | val a = await(1) + | val f = { case x => ({case x => neg1 * x}: PartialFunction[Int, Int])(x + a) }: PartialFunction[Int, Int] + | await(f(2)) | } | () | """.stripMargin) |