Commit f6f3b28
committed
Initialize static fields correctly
Currently the only way to put initializer inside
the static constructor is to use @static. However, CheckStatic
restricts that @static can only used in companion object, which
is a user-facing check, as MoveStatics can handle @static member
in the class.
We need a refactoring to make @static a general mechanism that
includes a phase to generate the static constructor. This needs
to be addressed in another PR.1 parent 96ae5ae commit f6f3b28
File tree
2 files changed
+5
-4
lines changed- compiler/src/dotty/tools/dotc
- transform
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
0 commit comments