Repository navigation
Commit 1fa74ff
authored
Fix redefinition logic for InitVar (#22352)
I know this is somewhat pedantic, but I cannot sleep well knowing we
have this in our code. Few things here:
* Everywhere else in mypy first definition wins, not the last one, so we
should do the same in presence of `InitVar`.
* Sorting strings is incorrect anyway, as it will put
`foo-redefinition-10` before `foo-redefinition-9`.
* Limit this special-case only to classes explicitly touched by plugins
(as indicated by non-trivial metadata)1 parent ccbf32b commit 1fa74ff
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4059 | 4059 | | |
4060 | 4060 | | |
4061 | 4061 | | |
4062 | | - | |
4063 | | - | |
4064 | | - | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
4065 | 4066 | | |
4066 | | - | |
4067 | 4067 | | |
4068 | 4068 | | |
4069 | 4069 | | |
| |||
0 commit comments