diff options
author | phaller <hallerp@gmail.com> | 2012-10-24 14:33:58 +0200 |
---|---|---|
committer | phaller <hallerp@gmail.com> | 2012-10-24 14:33:58 +0200 |
commit | 8c5cab6a7aa4ad6f4d0abd3629f41b96383f045e (patch) | |
tree | a40dd638a990343586021fc5d82638879b8b9c5d /src | |
parent | ee48ef9474fa0544432d15d64a6ddbc5d2e1facf (diff) | |
download | scala-async-8c5cab6a7aa4ad6f4d0abd3629f41b96383f045e.tar.gz scala-async-8c5cab6a7aa4ad6f4d0abd3629f41b96383f045e.tar.bz2 scala-async-8c5cab6a7aa4ad6f4d0abd3629f41b96383f045e.zip |
More docs for AsyncStateBuilder.complete
Diffstat (limited to 'src')
-rw-r--r-- | src/async/library/scala/async/Async.scala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/async/library/scala/async/Async.scala b/src/async/library/scala/async/Async.scala index 424a67d..c2a9cbb 100644 --- a/src/async/library/scala/async/Async.scala +++ b/src/async/library/scala/async/Async.scala @@ -54,8 +54,12 @@ class ExprBuilder[C <: Context with Singleton](val c: C) { def += (stat: c.Tree): Unit = stats += stat - /* Result needs to be created as a var at the beginning of the transformed method bodyso that - it is visible in subsequent states of the state machine. + /* Result needs to be created as a var at the beginning of the transformed method body, so that + * it is visible in subsequent states of the state machine. + * + * @param awaitArg the argument of await + * @param awaitResultName the name of the variable that the result of await is assigned to + * @param awaitResultType the type of the result of await */ def complete(awaitArg: c.Tree, awaitResultName: c.universe.TermName, awaitResultType: Tree): Unit = { awaitable = c.resetAllAttrs(awaitArg.duplicate) @@ -153,12 +157,12 @@ object Async extends AsyncUtils { import c.universe._ val builder = new ExprBuilder[c.type](c) + val awaitMethod = awaitSym(c) body.tree match { case Block(stats, expr) => val asyncStates = ListBuffer[builder.AsyncStateBuilder]() var stateBuilder = new builder.AsyncStateBuilder // current state builder - val awaitMethod = awaitSym(c) for (stat <- stats) { stat match { |