Repository navigation
New semantic analyzer: abstract classes - #6423
Merged
Merged
Conversation
ilevkivskyi
approved these changes
Feb 18, 2019
ilevkivskyi
left a comment
Member
There was a problem hiding this comment.
Looks good! I didn't check the implementations carefully since IIUC you basically copied them from old third pass.
| process_functions(graph, scc) | ||
| check_type_arguments(graph, scc) | ||
| check_type_arguments(graph, scc, errors) | ||
| process_abstract(graph, scc, errors) |
Member
There was a problem hiding this comment.
Bikeshedding: I would give it a longer name, like process_abstract_status.
| return None | ||
|
|
||
|
|
||
| def find_fixed_callable_return(expr: Expression) -> Optional[CallableType]: |
Member
There was a problem hiding this comment.
Maybe add a docstring while you are at it?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes abstract classes by moving determination of abstract
attributes to a new pass that happens between the main semantic
analysis pass and type checking. The new pass is added mostly
to simplify the main semantic analysis pass.
This also adds simple type inference for decorated functions from
the old semantic analysis pass 3. This fixes a test case where
we need access to the signature of an abstract method when type
checking the module top level. Since module top levels can't be
deferred during type checking, the simple type inference is needed
to remain compatible with the old semantic analyzer.
Fixes #6322.