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:
committed by
Space Team
parent
60455daa9d
commit
6fdfd4e8dd
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user