Commit d528707
authored
Fix decorated methods with self-types in protocols (#19484)
Fixes #19482
The regression is caused by overlap of three problems (directly or
indirectly):
* Using `mx.original_type` instead of `mx.self_type` for expanding (not
otherwise bound) self-types.
* Having a weird special case for `...` vs self-types in constraint
inference.
* Not refreshing type variable ids during protocol subtype checks (hack
needed for technical reasons).
I fix the first one, and limit the blast radius of the second one.1 parent f42c936 commit d528707
File tree
3 files changed
+19
-2
lines changed- mypy
- test-data/unit
3 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
| 959 | + | |
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
1113 | | - | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4646 | 4646 | | |
4647 | 4647 | | |
4648 | 4648 | | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
0 commit comments