Get rid of platform differences in Collection<T>.toTypedArray() doc

This commit is contained in:
Abduqodiri Qurbonzoda
2021-05-31 01:46:00 +03:00
committed by Space
parent c64592665b
commit cc3c33b8ae
2 changed files with 8 additions and 0 deletions
@@ -12,6 +12,13 @@ import kotlin.random.Random
@kotlin.internal.InlineOnly
public actual inline fun <T> Array<out T>?.orEmpty(): Array<out T> = this ?: emptyArray<T>()
/**
* Returns a *typed* array containing all of the elements of this collection.
*
* Allocates an array of runtime type `T` having its size equal to the size of this collection
* and populates the array with the elements of this collection.
* @sample samples.collections.Collections.Collections.collectionToTypedArray
*/
@kotlin.internal.InlineOnly
public actual inline fun <T> Collection<T>.toTypedArray(): Array<T> = copyToArray(this)