Commit 2e76eac
committed
Drop only transparent traits from intersections
Don't drop transparent classes. This means that a type such as
```
Any { type T = A } & Object
```
will be kept as is. Previously it was reduced to `Any { type T = A }`
but that feels wrong.
Transparent classes now only enter the picture for typing union types. If the
join of a union types consists only of transparent traits or classes, keep it
instead of widening it.1 parent 1717ed7 commit 2e76eac
File tree
5 files changed
+27
-20
lines changed- compiler/src/dotty/tools/dotc
- core
- typer
- docs/_docs/reference/other-new-features
- tests/pos
5 files changed
+27
-20
lines changedLines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | | - | |
| 561 | + | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
572 | | - | |
| 573 | + | |
573 | 574 | | |
574 | 575 | | |
575 | 576 | | |
576 | | - | |
577 | | - | |
| 577 | + | |
| 578 | + | |
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
582 | | - | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | | - | |
| 586 | + | |
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
592 | | - | |
| 593 | + | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
| |||
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
609 | | - | |
| 610 | + | |
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| |||
632 | 633 | | |
633 | 634 | | |
634 | 635 | | |
635 | | - | |
| 636 | + | |
636 | 637 | | |
637 | 638 | | |
638 | 639 | | |
| |||
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
666 | | - | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | | - | |
| 670 | + | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3011 | 3011 | | |
3012 | 3012 | | |
3013 | 3013 | | |
3014 | | - | |
3015 | | - | |
| 3014 | + | |
| 3015 | + | |
3016 | 3016 | | |
3017 | 3017 | | |
3018 | 3018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1210 | 1210 | | |
1211 | 1211 | | |
1212 | 1212 | | |
1213 | | - | |
| 1213 | + | |
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments