Skip to content

Fix crashes on variadic unpacking in synthetic types#21555

Open
ilevkivskyi wants to merge 1 commit into
python:masterfrom
ilevkivskyi:fix-newtype-tvt-crash
Open

Fix crashes on variadic unpacking in synthetic types#21555
ilevkivskyi wants to merge 1 commit into
python:masterfrom
ilevkivskyi:fix-newtype-tvt-crash

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

Fixes #21237 (and similar crashes).

The problem is that we cannot do some of the type argument normalization early in typeanal.py (since that will cause crashes on some pathological recursive aliases), so we do it in semanal_typeargs.py later. However, the mixed traverser visitor is somewhat incomplete (most notably w.r.t. generated methods). I add (most of) the missing parts.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
Copy link
Copy Markdown
Member Author

cc @JukkaL who added original TODO/FIX comments.

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.

unpacked two tuples in NewType crashes with AssertionError

1 participant