Remove reified constraint from Array constructors #KT-57363

This is an attempt to bring consistency to array constructors reified requirement.
Currently,
JVM - reified type in all three: arrayOfNulls, arrayOf, emptyArray
Native - reified in arrayOfNulls and arrayOf, but not in emptyArray
JS & Wasm - reified in arrayOfNulls, but not in arrayOf and emptyArray

Merge-request: KT-MR-11005
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
This commit is contained in:
Abduqodiri Qurbonzoda
2023-07-26 10:17:45 +00:00
committed by Space Team
parent 2a24eaeb74
commit 86c1e0ded6
4 changed files with 6 additions and 10 deletions
+1 -2
View File
@@ -7,7 +7,6 @@
package kotlin
import kotlin.internal.PureReifiable
import kotlin.js.*
/**
@@ -27,7 +26,7 @@ public operator fun String?.plus(other: Any?): String =
/**
* Returns an array of objects of the given type with the given [size], initialized with null values.
*/
public inline fun <reified T> arrayOfNulls(size: Int): Array<T?> = fillArrayVal<T?>(Array<T?>(size), null)
public inline fun <T> arrayOfNulls(size: Int): Array<T?> = fillArrayVal<T?>(Array<T?>(size), null)
/**
* Returns an array containing the specified elements.