Skip to content

Commit

Permalink
Use TreeNode#copyTagsFrom when transforming nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
rshkv committed Feb 19, 2021
1 parent 7b3087a commit bcb5098
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {
mapChildren(_.transformDown(rule))
} else {
// If the transform function replaces this node with a new one, carry over the tags.
afterRule.tags ++= this.tags
afterRule.copyTagsFrom(this)
afterRule.mapChildren(_.transformDown(rule))
}
}
Expand All @@ -319,7 +319,7 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {
}
}
// If the transform function replaces this node with a new one, carry over the tags.
newNode.tags ++= this.tags
newNode.copyTagsFrom(this)
newNode
}

Expand Down

0 comments on commit bcb5098

Please sign in to comment.