Commit 8978c6b
committed
Check invariant about the flags of pattern-bound symbols
The following invariant should be true for pattern-bound symbols,
and *only* for pattern-bound symbols:
(sym.isType && !sym.isClass && sym.isOneOf(Case)) ||
(sym.isTerm && sym.isOneOf(Case, butNot = Enum | Module))
The invariant only holds before patternMatcher.
After patternMatcher, there are no more pattern trees,
thus the invariant does not hold any more.1 parent 30c9e3e commit 8978c6b
File tree
2 files changed
+35
-5
lines changed- compiler/src/dotty/tools/dotc
- core
- transform
2 files changed
+35
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
| |||
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | | - | |
| 376 | + | |
| 377 | + | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
| |||
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| 396 | + | |
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
| |||
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
174 | 183 | | |
175 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
176 | 192 | | |
177 | | - | |
| 193 | + | |
178 | 194 | | |
179 | 195 | | |
180 | 196 | | |
| |||
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | | - | |
193 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
194 | 221 | | |
195 | 222 | | |
196 | 223 | | |
| |||
0 commit comments