Skip to content
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

Fix crash on single item union of alias #14876

Merged
merged 3 commits into from
Mar 18, 2023

Conversation

ilevkivskyi
Copy link
Member

Fixes #14744

Note: I didn't add the fix yet (which is simple, although really subtle), because I want to check that test case I added consistently fails with compiled mypy.

@github-actions

This comment has been minimized.

@ilevkivskyi
Copy link
Member Author

OK, the tests are failing with exactly the traceback from the issue. I am going to apply the fix now.

@ilevkivskyi ilevkivskyi requested a review from JukkaL March 11, 2023 14:48
@github-actions

This comment has been minimized.

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! Should it be testCompiledNoCrashOnSingleItemUnion instead of testNoCompiledCrashOnSingleItemUnion :-)

@github-actions
Copy link
Contributor

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

@ilevkivskyi
Copy link
Member Author

I did some perf measurements and impact from this seems minimal, so I am going to merge this now.

@ilevkivskyi ilevkivskyi merged commit fccaab0 into python:master Mar 18, 2023
@ilevkivskyi ilevkivskyi deleted the fix-alias-crash branch March 18, 2023 22:28
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.

Crash with 'mypy.types.ProperType object expected; got mypy.types.TypeAliasType'
2 participants