-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters