Hide subarrayContentToString in Native&Wasm

This commit is contained in:
Ilya Gorbunov
2022-04-08 17:55:58 +03:00
committed by Space
parent 1845e326d1
commit f3cf8cc13b
2 changed files with 9 additions and 5 deletions
@@ -160,8 +160,7 @@ actual class ArrayList<E> private constructor(
} }
override fun toString(): String { override fun toString(): String {
@Suppress("DEPRECATION_ERROR") return backingArray.subarrayContentToStringImpl(offset, length)
return backingArray.subarrayContentToString(offset, length)
} }
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@@ -5,8 +5,6 @@
package kotlin.collections package kotlin.collections
import kotlin.internal.PureReifiable
/** /**
* Returns the array if it's not `null`, or an empty array otherwise. * Returns the array if it's not `null`, or an empty array otherwise.
* @sample samples.collections.Arrays.Usage.arrayOrEmpty * @sample samples.collections.Arrays.Usage.arrayOrEmpty
@@ -27,8 +25,15 @@ internal fun checkCopyOfRangeArguments(fromIndex: Int, toIndex: Int, size: Int)
*/ */
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@Deprecated("This function will become internal soon.") @Deprecated("This function will become internal soon.")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5") @DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.7")
public inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String { public inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String {
return subarrayContentToStringImpl(offset, length)
}
@kotlin.internal.InlineOnly
@PublishedApi
// TODO: Rename back to subarrayContentToString after dropping that public function
internal inline fun <T> Array<out T>.subarrayContentToStringImpl(offset: Int, length: Int): String {
val sb = StringBuilder(2 + length * 3) val sb = StringBuilder(2 + length * 3)
sb.append("[") sb.append("[")
var i = 0 var i = 0