diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-21 23:46:46 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-21 23:46:46 +0100 |
commit | b089630c223d510899ecf74f0cd57b0ae3ad3842 (patch) | |
tree | 235861633c4fcfbfef5d495ef3516eb5526146c1 /src/main/scala | |
parent | 10aa18736a1d5161f9ad34ebcd9a6a756c904666 (diff) | |
download | scala-async-b089630c223d510899ecf74f0cd57b0ae3ad3842.tar.gz scala-async-b089630c223d510899ecf74f0cd57b0ae3ad3842.tar.bz2 scala-async-b089630c223d510899ecf74f0cd57b0ae3ad3842.zip |
Preserve ValDef symbol.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/AnfTransform.scala | 2 | ||||
-rw-r--r-- | src/main/scala/scala/async/Async.scala | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/scala/async/AnfTransform.scala b/src/main/scala/scala/async/AnfTransform.scala index 74f7211..e1d7cd5 100644 --- a/src/main/scala/scala/async/AnfTransform.scala +++ b/src/main/scala/scala/async/AnfTransform.scala @@ -66,7 +66,7 @@ class AnfTransform[C <: Context](override val c: C) extends TransformUtils(c) { case ValDef(mods, name, tpt, rhs) => val stats :+ expr = inline.transformToList(rhs) - stats :+ ValDef(mods, name, tpt, expr) + stats :+ ValDef(mods, name, tpt, expr).setSymbol(tree.symbol) case Assign(name, rhs) => val stats :+ expr = inline.transformToList(rhs) diff --git a/src/main/scala/scala/async/Async.scala b/src/main/scala/scala/async/Async.scala index 30b393e..94f42c0 100644 --- a/src/main/scala/scala/async/Async.scala +++ b/src/main/scala/scala/async/Async.scala @@ -101,6 +101,10 @@ abstract class AsyncBase { val initStates = asyncBlockBuilder.asyncStates.init val localVarTrees = asyncBlockBuilder.asyncStates.flatMap(_.allVarDefs).toList + val renameMap = traverser.liftable.map { + vd => + (vd.symbol, c.fresh(vd.name)) + }.toMap /* lazy val onCompleteHandler = (tr: Try[Any]) => state match { |