Skip to content

Enforce Syntax Trees Invariantrs #5006

@matklad

Description

@matklad

We have couple of weak invariants about our syntax trees, which are not really enforced and sometimes are broken in practice. We should

  • document invariants
  • assert them
  • make sure that they are obeyed in practice

Here's the tentative list of invariants:

Notably, the following is not an invariant, but we rely on it in some ast extensions:

  • Parent nodes are not guaranteed to exist.

For example, ast::EnumVariant should return Option

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-ArchitectureBig architectural things which we need to figure up-front (or suggestions for rewrites :0) )S-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions