aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-11-07 09:26:53 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-11-07 09:30:20 +0100
commit1942128eba3e73a845cad7e2c209ce53d6386645 (patch)
tree77a4be3c8e187496c6571662d454554ba18a7b23
parent77b59499c87230c4c183cfee3734d11941930609 (diff)
downloadscala-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.scala16
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