-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New semantic analyzer: generalize placeholders to all symbol nodes (#…
…6336) This generalizes the concept of placeholder nodes to also cover assignment statements and imports. Previously they were only created for class definitions. The main motivation is to prevent access to definitions in outer namespaces if there is an incomplete definition that should take precedence. Fixes #6299. This also does a few other updates: * During the final iteration, some references to placeholder nodes generate an error instead of producing placeholder nodes. This allows the analysis to terminate in certain cases of import cycles at least. * Major refactoring of `analyze_name_lvalue`. The motivation is that some early experiments made the old structure unwieldy, but the refactoring may not be as important for the final design. This seems like a code quality improvement so I'm including it here. * If a name lvalue was bound during an earlier iteration, we don't rebind it. I'd like to gradually move to this approach more generally. * Some forward references to names aren't treated as undefined any more. I think that these worked by accident. Now these generally generate "cannot determine type" errors. * Most definitions won't generate incomplete namespaces any more, since placeholders count as definitions in this context. Star imports still generate incomplete namespaces. * Remove redundant flags from some test cases.
- Loading branch information
Showing
7 changed files
with
238 additions
and
157 deletions.
There are no files selected for viewing
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
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
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.