Skip to content

Commit 025e91f

Browse files
author
Antoine Brunner
committed
Add necessary method for bootstrapped compilation
1 parent 646caa4 commit 025e91f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

library/src/scala/runtime/DynamicTuple.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ object DynamicTuple {
66
inline val MaxSpecialized = 22
77
inline private val XXL = MaxSpecialized + 1
88

9+
def to$Array(xs: Tuple, n: Int) = {
10+
val arr = new Array[Object](n)
11+
var i = 0
12+
var it = xs.asInstanceOf[Product].productIterator
13+
while (i < n) {
14+
arr(i) = it.next().asInstanceOf[Object]
15+
i += 1
16+
}
17+
arr
18+
}
19+
20+
def cons$Array[H](x: H, elems: Array[Object]): Array[Object] = {
21+
val elems1 = new Array[Object](elems.length + 1)
22+
elems1(0) = x.asInstanceOf[Object]
23+
System.arraycopy(elems, 0, elems1, 1, elems.length)
24+
elems1
25+
}
26+
927
def dynamicToArray(self: Tuple): Array[Object] = (self: Any) match {
1028
case self: Unit => Array.emptyObjectArray
1129
case self: TupleXXL => self.toArray

0 commit comments

Comments
 (0)