Skip to content

Visit resolved forward refs by third pass type visitor #5433

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

Merged
merged 4 commits into from
Aug 8, 2018

Conversation

ilevkivskyi
Copy link
Member

Fixes #4649

This also fixes similar cases of crashes with extreme forward referencing. The idea is quite straightforward, previously forward references just resolved during third pass were not accepted by the third pass visitor itself, this is now fixed.

@ilevkivskyi ilevkivskyi requested a review from msullivan August 8, 2018 17:10
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# otherwise the type checker may crash as it expects
# things to be right.
t.args = [AnyType(TypeOfAny.from_error) for _ in t.type.type_vars]
t.invalid = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did anything change here, or is it a pure refactor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pure refactor. I first tried a different solution, that required calling this manually from other module, but then found a simpler solution. However, looking at it, it seemed to me it actually looks better as a separate function (all visitor methods look compact this way).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, just wanted to check I wasn't missing anything

@msullivan msullivan merged commit 61d17ff into python:master Aug 8, 2018
@ilevkivskyi ilevkivskyi deleted the fix-forward-instance branch August 8, 2018 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report of INTERNAL ERROR with minimal reproduction
2 participants