diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/scala/scala/async/AsyncUtils.scala | 5 | ||||
-rw-r--r-- | src/main/scala/scala/async/ExprBuilder.scala | 4 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/main/scala/scala/async/AsyncUtils.scala b/src/main/scala/scala/async/AsyncUtils.scala index 19e9d92..d288d34 100644 --- a/src/main/scala/scala/async/AsyncUtils.scala +++ b/src/main/scala/scala/async/AsyncUtils.scala @@ -28,9 +28,4 @@ trait AsyncUtils { val tpe = asyncMod.moduleClass.asType.toType tpe.member(c.universe.newTermName("awaitCps")) } - - private var cnt = 0 - protected[async] def freshString(prefix: String): String = - prefix + "$async$" + { cnt += 1; cnt } - } diff --git a/src/main/scala/scala/async/ExprBuilder.scala b/src/main/scala/scala/async/ExprBuilder.scala index 655c26f..aaf15cc 100644 --- a/src/main/scala/scala/async/ExprBuilder.scala +++ b/src/main/scala/scala/async/ExprBuilder.scala @@ -418,7 +418,7 @@ class ExprBuilder[C <: Context with Singleton](val c: C) extends AsyncUtils { for (stat <- stats) stat match { // the val name = await(..) pattern case ValDef(mods, name, tpt, Apply(fun, args)) if fun.symbol == awaitMethod => - val newName = newTermName(Async.freshString(name.toString())) + val newName = c.fresh(name) toRename += (stat.symbol -> newName) asyncStates += stateBuilder.complete(args(0), newName, tpt, toRename).result // complete with await @@ -432,7 +432,7 @@ class ExprBuilder[C <: Context with Singleton](val c: C) extends AsyncUtils { case ValDef(mods, name, tpt, rhs) => checkForUnsupportedAwait(rhs) - val newName = newTermName(Async.freshString(name.toString())) + val newName = c.fresh(name) toRename += (stat.symbol -> newName) // when adding assignment need to take `toRename` into account stateBuilder.addVarDef(mods, newName, tpt, rhs, toRename) |