From 8c5cab6a7aa4ad6f4d0abd3629f41b96383f045e Mon Sep 17 00:00:00 2001 From: phaller Date: Wed, 24 Oct 2012 14:33:58 +0200 Subject: More docs for AsyncStateBuilder.complete --- src/async/library/scala/async/Async.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/async/library/scala') 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 { -- cgit v1.2.3