-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[red-knot] add Declarations support to semantic indexing (#13334)
Add support for declared types to the semantic index. This involves a lot of renaming to clarify the distinction between bindings and declarations. The Definition (or more specifically, the DefinitionKind) becomes responsible for determining which definitions are bindings, which are declarations, and which are both, and the symbol table building is refactored a bit so that the `IS_BOUND` (renamed from `IS_DEFINED` for consistent terminology) flag is always set when a binding is added, rather than being set separately (and requiring us to ensure it is set properly). The `SymbolState` is split into two parts, `SymbolBindings` and `SymbolDeclarations`, because we need to store live bindings for every declaration and live declarations for every binding; the split lets us do this without storing more than we need. The massive doc comment in `use_def.rs` is updated to reflect bindings vs declarations. The `UseDefMap` gains some new APIs which are allow-unused for now, since this PR doesn't yet update type inference to take declarations into account.
- Loading branch information
Showing
8 changed files
with
958 additions
and
474 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.