diff --git a/libraries/stdlib/common/src/generated/_Arrays.kt b/libraries/stdlib/common/src/generated/_Arrays.kt index 2aae07f587d..3dd538cd50d 100644 --- a/libraries/stdlib/common/src/generated/_Arrays.kt +++ b/libraries/stdlib/common/src/generated/_Arrays.kt @@ -9610,9 +9610,11 @@ public inline fun CharArray.distinctBy(selector: (Char) -> K): List { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun Array.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9621,9 +9623,11 @@ public infix fun Array.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun ByteArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9632,9 +9636,11 @@ public infix fun ByteArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun ShortArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9643,9 +9649,11 @@ public infix fun ShortArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun IntArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9654,9 +9662,11 @@ public infix fun IntArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun LongArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9665,9 +9675,11 @@ public infix fun LongArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun FloatArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9676,9 +9688,11 @@ public infix fun FloatArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun DoubleArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9687,9 +9701,11 @@ public infix fun DoubleArray.intersect(other: Iterable): Set { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun BooleanArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9698,9 +9714,11 @@ public infix fun BooleanArray.intersect(other: Iterable): Set } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this array and the specified collection. * * The returned set preserves the element iteration order of the original array. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun CharArray.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -9912,6 +9930,8 @@ public fun CharArray.toMutableSet(): MutableSet { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun Array.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9925,6 +9945,8 @@ public infix fun Array.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun ByteArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9938,6 +9960,8 @@ public infix fun ByteArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun ShortArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9951,6 +9975,8 @@ public infix fun ShortArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun IntArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9964,6 +9990,8 @@ public infix fun IntArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun LongArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9977,6 +10005,8 @@ public infix fun LongArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun FloatArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -9990,6 +10020,8 @@ public infix fun FloatArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun DoubleArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -10003,6 +10035,8 @@ public infix fun DoubleArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun BooleanArray.union(other: Iterable): Set { val set = this.toMutableSet() @@ -10016,6 +10050,8 @@ public infix fun BooleanArray.union(other: Iterable): Set { * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun CharArray.union(other: Iterable): Set { val set = this.toMutableSet() diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt index a555bd6637a..2add9a8b594 100644 --- a/libraries/stdlib/common/src/generated/_Collections.kt +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -1419,9 +1419,11 @@ public inline fun Iterable.distinctBy(selector: (T) -> K): List { } /** - * Returns a set containing all elements that are contained by both this set and the specified collection. + * Returns a set containing all elements that are contained by both this collection and the specified collection. * * The returned set preserves the element iteration order of the original collection. + * + * To get a set containing all elements that are contained at least in one of these collections use [union]. */ public infix fun Iterable.intersect(other: Iterable): Set { val set = this.toMutableSet() @@ -1458,6 +1460,8 @@ public fun Iterable.toMutableSet(): MutableSet { * The returned set preserves the element iteration order of the original collection. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. + * + * To get a set containing all elements that are contained in both collections use [intersect]. */ public infix fun Iterable.union(other: Iterable): Set { val set = this.toMutableSet() diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt index 07cc4a251b2..82d0b03f072 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt @@ -113,6 +113,8 @@ object SetOps : TemplateGroupBase() { The returned set preserves the element iteration order of the original ${f.collection}. Those elements of the [other] collection that are unique are iterated in the end in the order of the [other] collection. + + To get a set containing all elements that are contained in both collections use [intersect]. """ } returns("Set") @@ -131,9 +133,11 @@ object SetOps : TemplateGroupBase() { infix() doc { """ - Returns a set containing all elements that are contained by both this set and the specified collection. + Returns a set containing all elements that are contained by both this ${f.collection} and the specified collection. The returned set preserves the element iteration order of the original ${f.collection}. + + To get a set containing all elements that are contained at least in one of these collections use [union]. """ } returns("Set")