Open matklad opened 4 years ago
We have couple of weak invariants about our syntax trees, which are not really enforced and sometimes are broken in practice. We should
assert
Here's the tentative list of invariants:
SourceFile
Notably, the following is not an invariant, but we rely on it in some ast extensions:
For example, ast::EnumVariant should return Option
ast::EnumVariant
Option
https://github.com/rust-analyzer/rust-analyzer/pull/4680 is something we neeed to look at as well.
We have couple of weak invariants about our syntax trees, which are not really enforced and sometimes are broken in practice. We should
assert
themHere's the tentative list of invariants:
SourceFile
Notably, the following is not an invariant, but we rely on it in some ast extensions:
For example,
ast::EnumVariant
should returnOption