We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66967f9 commit 41aba4bCopy full SHA for 41aba4b
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -1379,11 +1379,11 @@ object Trees {
1379
// Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
1380
def apply(x: X, tree: Tree)(using Context): X
1381
1382
- def apply(x: X, trees: List[Tree])(using Context): X = trees match
1383
- case tree :: rest =>
1384
- apply(apply(x, tree), rest)
1385
- case Nil =>
1386
- x
+ def apply(x: X, trees: List[Tree])(using Context): X =
+ def fold(x: X, trees: List[Tree]): X = trees match
+ case tree :: rest => fold(apply(x, tree), rest)
+ case Nil => x
+ fold(x, trees)
1387
1388
def foldOver(x: X, tree: Tree)(using Context): X =
1389
if (tree.source != ctx.source && tree.source.exists)
0 commit comments