Commit abaa189
authored
[red-knot] handle cycles in MRO/bases resolution (#16693)
There can be semi-cyclic inheritance patterns (e.g. recursive generics)
that are not technically inheritance cycles, but that can cause us to
hit Salsa query cycles in evaluating a type's MRO. Add fixed-point
handling to these MRO-related queries so we don't panic on these cycles.
The details of what queries we hit in what order in this case will
change as we implement support for generics, but ultimately we will
probably need cycle handling for all queries that can re-enter type
inference, otherwise we are susceptible to small changes in query
execution order causing panics.
Fixes #14333
Further reduces the panicking set of seeds in #147371 parent 360ba09 commit abaa189
File tree
3 files changed
+74
-3
lines changed- crates/red_knot_python_semantic
- resources/mdtest/generics
- src
- types
3 files changed
+74
-3
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
| 1560 | + | |
1560 | 1561 | | |
1561 | 1562 | | |
1562 | 1563 | | |
| |||
1678 | 1679 | | |
1679 | 1680 | | |
1680 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1681 | 1688 | | |
1682 | 1689 | | |
1683 | 1690 | | |
| |||
1910 | 1917 | | |
1911 | 1918 | | |
1912 | 1919 | | |
| 1920 | + | |
1913 | 1921 | | |
1914 | 1922 | | |
1915 | 1923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
46 | 90 | | |
47 | 91 | | |
48 | 92 | | |
| |||
81 | 125 | | |
82 | 126 | | |
83 | 127 | | |
84 | | - | |
| 128 | + | |
85 | 129 | | |
| 130 | + | |
86 | 131 | | |
87 | 132 | | |
88 | 133 | | |
| |||
110 | 155 | | |
111 | 156 | | |
112 | 157 | | |
| 158 | + | |
113 | 159 | | |
114 | 160 | | |
115 | 161 | | |
| |||
141 | 187 | | |
142 | 188 | | |
143 | 189 | | |
144 | | - | |
| 190 | + | |
145 | 191 | | |
| 192 | + | |
146 | 193 | | |
147 | 194 | | |
148 | 195 | | |
| |||
199 | 246 | | |
200 | 247 | | |
201 | 248 | | |
| 249 | + | |
| 250 | + | |
202 | 251 | | |
203 | 252 | | |
204 | 253 | | |
| |||
662 | 711 | | |
663 | 712 | | |
664 | 713 | | |
665 | | - | |
| 714 | + | |
666 | 715 | | |
667 | 716 | | |
668 | 717 | | |
| |||
694 | 743 | | |
695 | 744 | | |
696 | 745 | | |
| 746 | + | |
| 747 | + | |
697 | 748 | | |
698 | 749 | | |
699 | 750 | | |
| |||
0 commit comments