Commit f7ba81c
authored
Change logic to find members of recursive types (#17386)
The previous logic used two boolean variables to selectively create
defensive copies. It was quite complicated. The new logic is simpler and
copies less.
- It copies only if the same recursive type is accessed with two
different prefixes. As long as the prefix stays the same,no confusion in
the `substRecThis` is possible.
- It avoids the openedTwice logic that causes defensive copies at all
points in the future. It seems that trick is no longer necessary.
Fixes #17380 by avoiding infinite recursion due to defensive copies.
Fixes #17381 as well.File tree
3 files changed
+25
-23
lines changed- compiler/src/dotty/tools/dotc/core
- tests/pos
3 files changed
+25
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
754 | 748 | | |
755 | | - | |
756 | | - | |
| 749 | + | |
757 | 750 | | |
758 | | - | |
759 | 751 | | |
760 | | - | |
| 752 | + | |
761 | 753 | | |
762 | | - | |
763 | | - | |
764 | | - | |
| 754 | + | |
| 755 | + | |
765 | 756 | | |
766 | 757 | | |
767 | 758 | | |
| |||
3191 | 3182 | | |
3192 | 3183 | | |
3193 | 3184 | | |
3194 | | - | |
3195 | | - | |
3196 | | - | |
| 3185 | + | |
| 3186 | + | |
3197 | 3187 | | |
3198 | 3188 | | |
3199 | 3189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments