Commit a0be3d6
committed
Fix pattern generation in "ordinal" mirror method
The "ordinal" method generated non-sensical patterns if the cases
of a sealed trait were found in the trait itself. In that case the
ordinal method would be placed in the companion object, but still tried
to access the cases via the `this` of the companion class.
We are now more careful and fall back to type projections in
comparisons.
Fixes scala#175561 parent fe08f5f commit a0be3d6
File tree
4 files changed
+38
-9
lines changed- compiler/src/dotty/tools/dotc
- core
- transform
- tests/pos
4 files changed
+38
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | | - | |
| 1512 | + | |
1513 | 1513 | | |
1514 | | - | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1515 | 1520 | | |
1516 | 1521 | | |
1517 | 1522 | | |
1518 | 1523 | | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
1519 | 1530 | | |
1520 | | - | |
1521 | | - | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
1522 | 1535 | | |
1523 | 1536 | | |
1524 | 1537 | | |
| |||
1533 | 1546 | | |
1534 | 1547 | | |
1535 | 1548 | | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
1536 | 1561 | | |
1537 | 1562 | | |
1538 | 1563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 314 | | |
319 | 315 | | |
320 | 316 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments