Commit 7feba77
committed
Treat Scala.js pseudo-unions in Scala 2 symbols as real unions
When unpickling a Scala 2 symbol, we now treat `scala.scalajs.js.|[A,
B]` as if it were a real `A | B`, this requires a special-case in erasure
to emit the correct signatures in SJSIR.
Remaining issues after this commit fixed in later commits of this PR:
- The companion object of `js.|` defines implicit conversions like
`undefOr2ops`, those are no longer automatically in scope for values
with a union type (which breaks many JUnitTests).
- When compiling Scala.js code from source, `A | B` is interpreted
as `js.|[A, B]` if `js.|` is in scope (e.g. via an import).
Additionally, a few tests had to be disabled until we can depend on
their fixed upstream version (scala-js/scala-js#4451).1 parent 65df24d commit 7feba77
File tree
9 files changed
+82
-9
lines changed- compiler/src/dotty/tools/dotc/core
- unpickleScala2
- project
- sbt-dotty/sbt-test/scala2-compat/erasure-scalajs
- dottyApp
- project
- scala2Lib
- tests/neg-scalajs
9 files changed
+82
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
526 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
527 | 540 | | |
528 | 541 | | |
529 | 542 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
| |||
690 | 695 | | |
691 | 696 | | |
692 | 697 | | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | 698 | | |
698 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
699 | 703 | | |
700 | 704 | | |
701 | 705 | | |
| |||
777 | 781 | | |
778 | 782 | | |
779 | 783 | | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
780 | 790 | | |
781 | 791 | | |
782 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | | - | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1111 | 1114 | | |
1112 | 1115 | | |
1113 | 1116 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
0 commit comments