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 partial type inference within a lambda #14087

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

ilevkivskyi
Copy link
Member

Fixes #9654

Seems to be quite straightforward. Erased types should never be stored on variables, it is just a temporary thing for nested generic calls.

@github-actions

This comment has been minimized.

Copy link
Collaborator

@Michael0x2a Michael0x2a left a comment

Choose a reason for hiding this comment

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

Instead of calling has_erased_component, maybe it might be better to modify NothingSeeker so it'll also check for erased types?

It would let us avoid making an extra pass over the type. We also use NothingSeeker only here, so the change wouldn't disrupt other logic.

@github-actions
Copy link
Contributor

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

@ilevkivskyi ilevkivskyi merged commit cf59b82 into python:master Nov 14, 2022
@ilevkivskyi ilevkivskyi deleted the fix-erased-crash branch November 14, 2022 08:43
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.

NotImplementedError: Cannot serialize ErasedType instance
2 participants