Commit b5107a9
authored
Fix crash in dataclass protocol with self attribute assignment (#15157)
Fix #15004
FWIW I don't think dataclass protocols make much sense, but we
definitely should not crash. Also the root cause has nothing to do with
dataclasses, the problem is that a self attribute assignment in a
protocol created a new `Var` (after an original `Var` was created in
class body), which is obviously wrong.1 parent 9f69bea commit b5107a9
File tree
3 files changed
+37
-5
lines changed- mypy
- test-data/unit
3 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3647 | 3647 | | |
3648 | 3648 | | |
3649 | 3649 | | |
3650 | | - | |
| 3650 | + | |
3651 | 3651 | | |
3652 | 3652 | | |
3653 | 3653 | | |
| |||
3824 | 3824 | | |
3825 | 3825 | | |
3826 | 3826 | | |
3827 | | - | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
3828 | 3830 | | |
3829 | 3831 | | |
3830 | 3832 | | |
| |||
3853 | 3855 | | |
3854 | 3856 | | |
3855 | 3857 | | |
3856 | | - | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
3857 | 3863 | | |
| 3864 | + | |
3858 | 3865 | | |
3859 | | - | |
| 3866 | + | |
| 3867 | + | |
3860 | 3868 | | |
3861 | | - | |
| 3869 | + | |
3862 | 3870 | | |
3863 | 3871 | | |
3864 | 3872 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2037 | 2037 | | |
2038 | 2038 | | |
2039 | 2039 | | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4054 | 4054 | | |
4055 | 4055 | | |
4056 | 4056 | | |
| 4057 | + | |
| 4058 | + | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
0 commit comments