Skip to content

New semantic analyzer: calculating fallback types #6400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JukkaL opened this issue Feb 14, 2019 · 0 comments · Fixed by #6442
Closed

New semantic analyzer: calculating fallback types #6400

JukkaL opened this issue Feb 14, 2019 · 0 comments · Fixed by #6442
Assignees
Labels
semantic-analyzer Problems that happen during semantic analysis

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 14, 2019

Some fallback types can't be calculated during the main semantic analysis pass, since they require joins. We can either calculate the fallbacks in a later pass before type checking, or we can calculate them on demand during type checking. I'm leaning towards the latter option.

@JukkaL JukkaL added the semantic-analyzer Problems that happen during semantic analysis label Feb 14, 2019
@JukkaL JukkaL self-assigned this Feb 18, 2019
JukkaL added a commit that referenced this issue Feb 22, 2019
This changes tuple fallbacks to be calculated on demand during
type checking. This fixes some issues with fallbacks being imprecise.

In the new semantic analyzer, this introduces a new pass just after
the main semantic analysis pass to calculate precise item types for
`tuple` base classes. These can't be calculated on demand since
the base class is a variable-length tuple type (`Instance`) instead
of `TupleType`. We can't calculate these during the main semantic
analysis pass since base classes can be incomplete.

Fixes #6400.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semantic-analyzer Problems that happen during semantic analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant