Skip to content

Fix narrowing down TypedDict unions with enum literal types #10415

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 1 commit into from
May 4, 2021

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 4, 2021

A union of enum literals was merged back to the enum type, which broke
type narrowing. Disable merging in this case to work around the
issue.

The fix feels a bit ad hoc. However, I'd rather not spend a lot of
time figuring out a general fix, since this seems like a pretty rare
edge case.

Fixes #10414.

A union of enum literals was merged back to the enum type, which broke
type narrowing. Disable merging in this case to work around the
issue.

The fix feels a bit ad hoc. However, I'd rather not spend a lot of
time figuring out a general fix, since this seems like a pretty rare
edge case.

Fixes #10414.
@JukkaL JukkaL merged commit 0729345 into master May 4, 2021
@JukkaL JukkaL deleted the tdict-narrow-enum branch May 4, 2021 16:10
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.

TypedDict narrowing regression with enum literal
2 participants