Commit 1818b99
committed
Run CompleteJavaEnums after erasure
CompleteJavaEnums changes some signatures (it adds extra constructor
parameters to classes extending java.lang.Enum), so it is not allowed to
run before Erasure (this is enforced by the check added in TreeChecker
in the previous commit).
Moving CompleteJavaEnums after Erasure required one change, prior to
this commit, constructor parameter were added to enum cases in two
different places:
- `def $new(...) = { new E { ... } }` was handled by transformDefDef
- `val Foo = new E { ... }` was handled by transformTemplate
It turns out that we can just let transformTemplate handle both cases,
this simplifies the code and means that the Mixin phase can run after
CompleteJavaEnums in the same group and see the transformed
constructors.1 parent 49af5b8 commit 1818b99
File tree
3 files changed
+9
-29
lines changed- compiler/src/dotty/tools/dotc
- transform
3 files changed
+9
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
Lines changed: 3 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 80 | + | |
97 | 81 | | |
98 | 82 | | |
99 | 83 | | |
100 | 84 | | |
101 | 85 | | |
102 | 86 | | |
103 | 87 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 88 | | |
113 | 89 | | |
114 | 90 | | |
| |||
159 | 135 | | |
160 | 136 | | |
161 | 137 | | |
162 | | - | |
| 138 | + | |
| 139 | + | |
163 | 140 | | |
164 | 141 | | |
165 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
0 commit comments