Deprecate kotlin.jvm.internal.collectionToArray

This commit is contained in:
Abduqodiri Qurbonzoda
2023-07-24 11:39:31 +03:00
committed by Space Team
parent 7fc90c02f1
commit 524df83265
2 changed files with 8 additions and 1 deletions
@@ -14,6 +14,9 @@ import java.util.Arrays
private val EMPTY = emptyArray<Any?>() // shared empty array
private const val MAX_SIZE = Int.MAX_VALUE - 2 // empirically maximal array size that can be allocated without exceeding VM limits
// TODO: eventually should become internal @PublishedApi
@Deprecated("This function will be made internal in a future release")
@DeprecatedSinceKotlin(warningSince = "1.9")
@JvmName("toArray")
fun collectionToArray(collection: Collection<*>): Array<Any?> =
toArrayImpl(
@@ -24,6 +27,9 @@ fun collectionToArray(collection: Collection<*>): Array<Any?> =
)
// Note: Array<Any?> here can have any reference array JVM type at run time
// TODO: eventually should become internal @PublishedApi
@Deprecated("This function will be made internal in a future release")
@DeprecatedSinceKotlin(warningSince = "1.9")
@JvmName("toArray")
fun collectionToArray(collection: Collection<*>, a: Array<Any?>?): Array<Any?> {
// Collection.toArray contract requires that NullPointerException is thrown when array is null