File tree 1 file changed +11
-1
lines changed
compiler/src/dotty/tools/backend/jvm 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,18 @@ trait BCodeSkelBuilder extends BCodeHelpers {
116
116
// Because the assigments to both the module instance fields, and the fields of the module itself
117
117
// are in the <clinit>, these fields can be static + final.
118
118
119
- // TODO should we do this transformation earlier, say in Constructors? Or would that just cause
119
+ // Should we do this transformation earlier, say in Constructors? Or would that just cause
120
120
// pain for scala-{js, native}?
121
+ //
122
+ // @sjrd (https://github.com/lampepfl/dotty/pull/9181#discussion_r457458205):
123
+ // moving that before the back-end would make things significantly more complicated for
124
+ // Scala.js and Native. Both have a first-class concept of ModuleClass, and encode the
125
+ // singleton pattern of MODULE$ in a completely different way. In the Scala.js IR, there
126
+ // even isn't anything that corresponds to MODULE$ per se.
127
+ //
128
+ // So if you move this before the back-end, then Scala.js and Scala Native will have to
129
+ // reverse all the effects of this transformation, which would be counter-productive.
130
+
121
131
122
132
// TODO: enable once we change lazy val encoding
123
133
//
You can’t perform that action at this time.
0 commit comments