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 f0ac5b6cf24..559d7dd7659 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/collections/MutableCollections.kt @@ -18,6 +18,8 @@ public actual fun > MutableList.sort(): Unit = sortWith(nat * Sorts elements in the list in-place according to the order specified with [comparator]. * * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @sample samples.collections.Collections.Sorting.sortMutableListWith */ public actual fun MutableList.sortWith(comparator: Comparator): Unit { if (size > 1) { diff --git a/libraries/stdlib/js/src/kotlin/collections.kt b/libraries/stdlib/js/src/kotlin/collections.kt index e61ac7b3e4b..0a5a982a784 100644 --- a/libraries/stdlib/js/src/kotlin/collections.kt +++ b/libraries/stdlib/js/src/kotlin/collections.kt @@ -159,6 +159,8 @@ public actual fun > MutableList.sort(): Unit { * Sorts elements in the list in-place according to the order specified with [comparator]. * * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @sample samples.collections.Collections.Sorting.sortMutableListWith */ public actual fun MutableList.sortWith(comparator: Comparator): Unit { collectionsSort(this, comparator)