ast.Node
shouldn't be used after COPY ( should regard COPY as MOVE )
#500
Labels
documentation
Improvements or additions to documentation
known-issue
This issue is known to us, we are working on it
Background
Since
ast.Node
introduceslazy-load
parsing mechanism, many APIs may change underlying pointer of a node. Therefore, once a node ispassed-by-value
to another place, the old one should never used --- in other words, Passing a node by value equals to the semantic of MOVE.Reproducible codes
result
How to resolve this problem if I still want to use old node?
The main idea is to UPDATE the old node's reference once you move it.
Given above example, if you still want to use the old node, you can change your code like below:
The text was updated successfully, but these errors were encountered: