File tree 2 files changed +45
-0
lines changed
compiler/src/main/scala/org/scalajs/core/compiler 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
package org .scalajs .core .compiler
7
7
8
+ import scala .language .implicitConversions
9
+
8
10
import scala .collection .mutable
9
11
10
12
import scala .tools .nsc ._
@@ -58,6 +60,48 @@ trait Compat210Component {
58
60
}
59
61
}
60
62
63
+ /* global.genBCode.bTypes.initializeCoreBTypes()
64
+ *
65
+ * This one has a very particular history:
66
+ * - in 2.10.x, no genBCode in global
67
+ * - in 2.11.{0-1}, there is genBCode but it has no bTypes member
68
+ * - In 2.11.{2-5}, there is genBCode.bTypes, but it has no
69
+ * initializeCoreBTypes (it was actually typo'ed as intializeCoreBTypes!)
70
+ * - In 2.11.6+, including 2.12, we finally have
71
+ * genBCode.bTypes.initializeCoreBTypes
72
+ * - As of 2.12.0-M4, it is mandatory to call that method from GenJSCode.run()
73
+ */
74
+
75
+ object LowPrioGenBCodeCompat {
76
+ object genBCode {
77
+ object bTypes {
78
+ def initializeCoreBTypes (): Unit = ()
79
+ }
80
+ }
81
+ }
82
+
83
+ def initializeCoreBTypesCompat (): Unit = {
84
+ import LowPrioGenBCodeCompat ._
85
+
86
+ {
87
+ import global ._
88
+
89
+ import LowPrioGenBCodeCompat .genBCode ._
90
+
91
+ {
92
+ import genBCode ._
93
+
94
+ import LowPrioGenBCodeCompat .genBCode .bTypes ._
95
+
96
+ {
97
+ import bTypes ._
98
+
99
+ initializeCoreBTypes()
100
+ }
101
+ }
102
+ }
103
+ }
104
+
61
105
// ErasedValueType has a different encoding
62
106
63
107
implicit final class ErasedValueTypeCompat (self : global.ErasedValueType ) {
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ abstract class GenJSCode extends plugins.PluginComponent
161
161
162
162
override def run (): Unit = {
163
163
scalaPrimitives.init()
164
+ initializeCoreBTypesCompat()
164
165
jsPrimitives.init()
165
166
super .run()
166
167
}
You can’t perform that action at this time.
0 commit comments