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 f30279f commit 8b790a6Copy full SHA for 8b790a6
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -1384,7 +1384,12 @@ object Trees {
1384
// Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
1385
def apply(x: X, tree: Tree)(using Context): X
1386
1387
- 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
1388
+ case tree :: rest =>
1389
+ apply(apply(x, tree), rest)
1390
+ case Nil =>
1391
+ x
1392
+
1393
def foldOver(x: X, tree: Tree)(using Context): X =
1394
if (tree.source != ctx.source && tree.source.exists)
1395
foldOver(x, tree)(using ctx.withSource(tree.source))
0 commit comments