diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt index fd2d44393a5..f0ac5b6cf24 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt @@ -9,6 +9,8 @@ package kotlin.collections * Sorts elements in the list in-place according to their natural sort order. * * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @sample samples.collections.Collections.Sorting.sortMutableList */ public actual fun > MutableList.sort(): Unit = sortWith(naturalOrder()) diff --git a/libraries/stdlib/js/src/kotlin/collections.kt b/libraries/stdlib/js/src/kotlin/collections.kt index 318cfe3b110..e61ac7b3e4b 100644 --- a/libraries/stdlib/js/src/kotlin/collections.kt +++ b/libraries/stdlib/js/src/kotlin/collections.kt @@ -148,6 +148,8 @@ public actual fun Iterable.shuffled(): List = toMutableList().apply { * Sorts elements in the list in-place according to their natural sort order. * * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @sample samples.collections.Collections.Sorting.sortMutableList */ public actual fun > MutableList.sort(): Unit { collectionsSort(this, naturalOrder())