diff --git a/libraries/stdlib/src/generated/_Arrays.kt b/libraries/stdlib/src/generated/_Arrays.kt index 0a6d9f152cb..f2e175b1f03 100644 --- a/libraries/stdlib/src/generated/_Arrays.kt +++ b/libraries/stdlib/src/generated/_Arrays.kt @@ -6900,87 +6900,6 @@ public fun ShortArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun Array.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun BooleanArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun ByteArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun CharArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun DoubleArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun FloatArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun IntArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun LongArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun ShortArray.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - /** * Returns a list containing only distinct elements from the given collection. * The elements in the resulting list are in the same order as they were in the source collection. @@ -10359,78 +10278,6 @@ public fun ShortArray.asSequence(): Sequence { } } -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun Array.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun BooleanArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun ByteArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun CharArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun DoubleArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun FloatArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun IntArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun LongArray.sequence(): Sequence { - return asSequence() -} - -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun ShortArray.sequence(): Sequence { - return asSequence() -} - /** * Returns a [List] that wraps the original array. */ diff --git a/libraries/stdlib/src/generated/_Collections.kt b/libraries/stdlib/src/generated/_Collections.kt index c87c30779f6..741b53226bf 100644 --- a/libraries/stdlib/src/generated/_Collections.kt +++ b/libraries/stdlib/src/generated/_Collections.kt @@ -1116,15 +1116,6 @@ public fun Iterable.withIndex(): Iterable> { return IndexingIterable { iterator() } } -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun Iterable.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - /** * Returns a list containing only distinct elements from the given collection. * The elements in the resulting list are in the same order as they were in the source collection. @@ -1650,14 +1641,6 @@ public fun Iterable.asSequence(): Sequence { } } -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun Iterable.sequence(): Sequence { - return asSequence() -} - /** * Returns a list containing all elements that are instances of specified type parameter R. */ diff --git a/libraries/stdlib/src/generated/_Maps.kt b/libraries/stdlib/src/generated/_Maps.kt index 78cb01a7a67..609543560c6 100644 --- a/libraries/stdlib/src/generated/_Maps.kt +++ b/libraries/stdlib/src/generated/_Maps.kt @@ -180,11 +180,3 @@ public fun Map.asSequence(): Sequence> { } } -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun Map.sequence(): Sequence> { - return asSequence() -} - diff --git a/libraries/stdlib/src/generated/_Sequences.kt b/libraries/stdlib/src/generated/_Sequences.kt index ab7698c2582..23f1a495191 100644 --- a/libraries/stdlib/src/generated/_Sequences.kt +++ b/libraries/stdlib/src/generated/_Sequences.kt @@ -601,15 +601,6 @@ public fun Sequence.withIndex(): Sequence> { return IndexingSequence(this) } -/** - * Returns a sequence containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun Sequence.withIndices(): Sequence> { - var index = 0 - return TransformingSequence(this, { index++ to it }) -} - /** * Returns a sequence containing only distinct elements from the given sequence. * The elements in the resulting sequence are in the same order as they were in the source sequence. @@ -989,14 +980,6 @@ public fun Sequence.asSequence(): Sequence { return this } -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun Sequence.sequence(): Sequence { - return this -} - /** * Returns a sequence containing all elements that are instances of specified type parameter R. */ diff --git a/libraries/stdlib/src/generated/_Strings.kt b/libraries/stdlib/src/generated/_Strings.kt index 1e303575980..6d11816d6fc 100644 --- a/libraries/stdlib/src/generated/_Strings.kt +++ b/libraries/stdlib/src/generated/_Strings.kt @@ -513,15 +513,6 @@ public fun String.withIndex(): Iterable> { return IndexingIterable { iterator() } } -/** - * Returns a list containing pairs of each element of the original collection and their index. - */ -@Deprecated("Use withIndex() instead.") -public fun String.withIndices(): List> { - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) -} - /** * Returns `true` if all elements match the given [predicate]. */ @@ -771,11 +762,3 @@ public fun String.asSequence(): Sequence { } } -/** - * Returns a sequence from the given collection - */ -@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) -public fun String.sequence(): Sequence { - return asSequence() -} - diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index 05280b84ef1..4867b53be3b 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -5,27 +5,6 @@ import templates.Family.* fun mapping(): List { val templates = arrayListOf() - templates add f("withIndices()") { - deprecate { "Use withIndex() instead." } - doc { "Returns a list containing pairs of each element of the original collection and their index." } - returns("List>") - body { - """ - var index = 0 - return mapTo(ArrayList>(), { index++ to it }) - """ - } - - returns(Sequences) { "Sequence>" } - doc(Sequences) { "Returns a sequence containing pairs of each element of the original collection and their index." } - body(Sequences) { - """ - var index = 0 - return TransformingSequence(this, { index++ to it }) - """ - } - } - templates add f("withIndex()") { doc { "Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection." } returns("Iterable>") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt index 6fb929dc583..22bb0aa58d2 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt @@ -5,25 +5,6 @@ import templates.Family.* fun sequences(): List { val templates = arrayListOf() - templates add f("sequence()") { - include(Maps) - exclude(Sequences) - deprecate { "Use asSequence() instead" } - deprecateReplacement { "asSequence()" } - doc { "Returns a sequence from the given collection" } - returns("Sequence") - body { - """ - return asSequence() - """ - } - - body(Sequences) { - """ - return this - """ - } - } templates add f("asSequence()") { include(Maps) doc { "Returns a sequence from the given collection." }