Skip to content

Detect duplicate nodes during printing #18978

@amcasey

Description

@amcasey

While rewriting code for refactorings and code fixes, it is quite easy to inadvertently insert a single Node into multiple positions in the tree (i.e. when it should have been cloned). It would be very helpful if the printer (or other, more appropriate, component) detected this, rather than behaving subtly incorrectly or throwing an (apparently) unrelated exception.

One way to do this would be to clear __pos and __end before traversing the tree and then throwing if they are set a second time during the traversal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions