Commit 57f8da3
authored
Ensure type of classmethod is consistent regardless of whether cls is annotated. (#87)
For example
```py
class C:
@classmethod
def f(cls) -> int: ...
@classmethod
def g(cls: type[C]) -> int: ...
```
The result of `GetMemberType` on each function was:
- `f`: `classmethod[C, tuple[()], int]`
- `g`: `classmethod[type[C], tuple[()], int]`1 parent 38ad82b commit 57f8da3
2 files changed
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
231 | 248 | | |
232 | 249 | | |
233 | 250 | | |
| |||
1642 | 1659 | | |
1643 | 1660 | | |
1644 | 1661 | | |
1645 | | - | |
| 1662 | + | |
1646 | 1663 | | |
1647 | 1664 | | |
1648 | 1665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | 602 | | |
606 | 603 | | |
607 | 604 | | |
| |||
658 | 655 | | |
659 | 656 | | |
660 | 657 | | |
661 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
662 | 667 | | |
663 | 668 | | |
664 | 669 | | |
| |||
0 commit comments