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 9149e6b commit 1b99845Copy full SHA for 1b99845
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -1375,7 +1375,12 @@ object Trees {
1375
// Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
1376
def apply(x: X, tree: Tree)(using Context): X
1377
1378
- def apply(x: X, trees: Traversable[Tree])(using Context): X = trees.foldLeft(x)(apply)
+ def apply(x: X, trees: List[Tree])(using Context): X = trees match
1379
+ case tree :: rest =>
1380
+ apply(apply(x, tree), rest)
1381
+ case Nil =>
1382
+ x
1383
+
1384
def foldOver(x: X, tree: Tree)(using Context): X =
1385
if (tree.source != ctx.source && tree.source.exists)
1386
foldOver(x, tree)(using ctx.withSource(tree.source))
0 commit comments