From 1942128eba3e73a845cad7e2c209ce53d6386645 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 7 Nov 2013 09:26:53 +0100 Subject: Scala 2.11 compatibility We were relying on an internal API that no longer exists. --- src/main/scala/scala/async/internal/AnfTransform.scala | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/main/scala') 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 -- cgit v1.2.3