Null-terminate Collection.toArray destination only in JVM

In other platforms the elements following the collection elements
should not be changed.

As a part of efforts to stabilize Native stdlib.
This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-01 12:52:46 +03:00
committed by Space Team
parent 60455daa9d
commit 6fdfd4e8dd
14 changed files with 46 additions and 40 deletions
@@ -24,7 +24,7 @@ fun abstractCollectionToArray() {
assertTrue("toArray1" in coll.invocations || "toArray2" in coll.invocations)
val arr2: Array<String> = coll.toArray(Array(coll.size + 1) { "" })
assertEquals(data + listOf(null), arr2.asList())
assertEquals(data + listOf(""), arr2.asList())
}
fun box(): String {