Commit 8a96cde
committed
Fix erasure of Java intersection without a class
When I implemented our erasure algorithm in
#11808, I misread
https://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.4 and
incorrectly thought that a Java intersection had to contain at least one
class, and since we always erase a Scala 3 intersection containing a
class to that class, I thought we could use the Scala 3 intersection
algorithm to erase Java intersections. But my assumption was incorrect:
a Java intersection can in fact contain only interfaces, so we need to
special-case them in erasure like before.
Fixes #12586.1 parent 1f4d125 commit 8a96cde
File tree
6 files changed
+46
-21
lines changed- compiler/src/dotty/tools/dotc
- core
- transform
- tests/run
- java-intersection
6 files changed
+46
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | 430 | | |
435 | 431 | | |
436 | 432 | | |
| |||
609 | 605 | | |
610 | 606 | | |
611 | 607 | | |
612 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
613 | 611 | | |
614 | 612 | | |
615 | 613 | | |
| |||
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
93 | 87 | | |
| 88 | + | |
| 89 | + | |
94 | 90 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 91 | + | |
99 | 92 | | |
100 | 93 | | |
101 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
1 | 13 | | |
2 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
3 | 18 | | |
4 | | - | |
5 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
6 | 25 | | |
7 | 26 | | |
0 commit comments