8000 Fix match crash on unions including tuples by ilevkivskyi · Pull Request #13514 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix match crash on unions including tuples #13514

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 2 commits into from
Aug 25, 2022

Conversation

ilevkivskyi
Copy link
Member

Fixes #12533

The fix is trivial. I also noticed the whole procedure in that function doesn't make much sense, left a TODO about it.

Copy link
Collaborator
@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Looks good, could be worth adding reveal_type to make sure the correct types are matched

@github-actions

This comment has been minimized.

@ilevkivskyi
Copy link
Member Author

Oh, it turns out inference was broken as well (in almost identical way). Was just couple more lines fix however. Note that in general inference is quite basic still, e.g. even for mildly non-trivial cases we fall back to homogeneous sequences.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

match crashes on Union of Tuple and non-Tuple
2 participants
0