File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1190,7 +1190,9 @@ object Trees {
11901190 }
11911191
11921192 abstract class TreeAccumulator [X ] {
1193+ // Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
11931194 def apply (x : X , tree : Tree )(implicit ctx : Context ): X
1195+
11941196 def apply (x : X , trees : Traversable [Tree ])(implicit ctx : Context ): X = (x /: trees)(apply)
11951197 def foldOver (x : X , tree : Tree )(implicit ctx : Context ): X = {
11961198 def localCtx =
@@ -1301,7 +1303,7 @@ object Trees {
13011303 class ShallowFolder [X ](f : (X , Tree ) => X ) extends TreeAccumulator [X ] {
13021304 def apply (x : X , tree : Tree )(implicit ctx : Context ): X = {
13031305 val x1 = f(x, tree)
1304- if (x1.asInstanceOf [AnyRef ] ne x1 .asInstanceOf [AnyRef ]) x1
1306+ if (x1.asInstanceOf [AnyRef ] ne x .asInstanceOf [AnyRef ]) x1
13051307 else foldOver(x1, tree)
13061308 }
13071309 }
You can’t perform that action at this time.
0 commit comments