You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix type inference in pattern matching by positional argument (#13618)
Oh, this was very interesting.
During the debug sessions I learned a lot about how pattern matching and
its analysis do work.
But, the problem was that `expand_type` did not preserve
`.last_known_value` for some reason.
I used `.copy_modified` to preserve everything we know about `Instance`.
However, I expect that some tests might fail now. This code even has
something similar in `TODO` some lines above:
https://github.com/python/mypy/blob/88aed94ae3de2542491f6cd65d1236c4f0cdedb1/mypy/expandtype.py#L144-L148
Let's see what will happen.
Closes#13612
0 commit comments