Skip to content

Crash with forward reference in TypedDict #3319

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 May 4, 2017 · 0 comments · Fixed by #3560
Closed

Crash with forward reference in TypedDict #3319

JukkaL opened this issue May 4, 2017 · 0 comments · Fixed by #3560

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented May 4, 2017

This causes a crash because we take a join during the second pass of semantic analysis when MROs aren't populated yet:

from mypy_extensions import TypedDict

X = TypedDict('X', {'b': 'B', 'c': int})

class B: pass

Originally reported by @JelleZijlstra as #3315, but separated the crash with TypedDict into this new issue.

@JukkaL JukkaL self-assigned this Jun 16, 2017
JukkaL added a commit that referenced this issue Jun 16, 2017
Move join to happen after semantic analysis to avoid crash due to
incomplete MRO in TypeInfo. The implementation uses a new semantic
analysis 'fixup' phase.

Fixes #3319.
gvanrossum pushed a commit that referenced this issue Jun 21, 2017
Move join to happen after semantic analysis to avoid crash due to
incomplete MRO in TypeInfo. The implementation uses a new semantic
analysis 'patch' phase.

Fixes #3319. Fixes #2489. Fixes #3316.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant