Skip to content

New semantic analyzer: Finish iterations after no names were added/modified #6485

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
ilevkivskyi opened this issue Feb 26, 2019 · 1 comment · Fixed by #6499
Closed

New semantic analyzer: Finish iterations after no names were added/modified #6485

ilevkivskyi opened this issue Feb 26, 2019 · 1 comment · Fixed by #6499
Labels
priority-0-high semantic-analyzer Problems that happen during semantic analysis

Comments

@ilevkivskyi
Copy link
Member

Currently we defer reporting undefined names until we reach iteration limit. A better solution would be to track whether any new names were added, and if not, make one more iteration where report all errors.

Note that this will also allow a cleaner solution for #6412

@ilevkivskyi ilevkivskyi added priority-0-high semantic-analyzer Problems that happen during semantic analysis labels Feb 26, 2019
@ilevkivskyi
Copy link
Member Author

One thing to be careful with is placeholder nodes: if they are replaced with a real node, it should count as an addition, but if one placeholder replaces another one, the we should count it as a change only in the new one is becomes_typeinfo=True.

I also it is better to have tests for type variables with values restrictions and bounds, since we put Anys there, defer, and add the variable. This relies on reprocessing the type variable definition.

JukkaL added a commit that referenced this issue Mar 1, 2019
…6499)

Keep track of added names. If an iteration didn't add anything new,
any further work is meaningless and the next iteration will be the last
one.

Avoid infinite loops by failing if the final iterations defers anything.

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

Successfully merging a pull request may close this issue.

1 participant