diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-11-07 09:26:53 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-07 09:30:20 +0100 |
commit | 1942128eba3e73a845cad7e2c209ce53d6386645 (patch) | |
tree | 77a4be3c8e187496c6571662d454554ba18a7b23 | |
parent | 77b59499c87230c4c183cfee3734d11941930609 (diff) | |
download | scala-async-1942128eba3e73a845cad7e2c209ce53d6386645.tar.gz scala-async-1942128eba3e73a845cad7e2c209ce53d6386645.tar.bz2 scala-async-1942128eba3e73a845cad7e2c209ce53d6386645.zip |
Scala 2.11 compatibility
We were relying on an internal API that no longer exists.
-rw-r--r-- | src/main/scala/scala/async/internal/AnfTransform.scala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/scala/scala/async/internal/AnfTransform.scala b/src/main/scala/scala/async/internal/AnfTransform.scala index f7f691d..f19a87a 100644 --- a/src/main/scala/scala/async/internal/AnfTransform.scala +++ b/src/main/scala/scala/async/internal/AnfTransform.scala @@ -203,7 +203,21 @@ private[async] trait AnfTransform { } } - val typedNewApply = copyApplied(tree, treeInfo.dissectApplied(tree).applyDepth) + + /** The depth of the nested applies: e.g. Apply(Apply(Apply(_, _), _), _) + * has depth 3. Continues through type applications (without counting them.) + */ + def applyDepth: Int = { + def loop(tree: Tree): Int = tree match { + case Apply(fn, _) => 1 + loop(fn) + case TypeApply(fn, _) => loop(fn) + case AppliedTypeTree(fn, _) => loop(fn) + case _ => 0 + } + loop(tree) + } + + val typedNewApply = copyApplied(tree, applyDepth) funStats ++ argStatss.flatten.flatten :+ typedNewApply |