From ea8529093907bdf910d88b3efd26c8e154bc06ca Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 27 May 2015 21:47:38 +0300 Subject: [PATCH] Annotate deprecated members with proposed replacement. --- libraries/stdlib/src/generated/_Sequences.kt | 52 +++++++++---------- .../stdlib/src/kotlin/collections/Sequence.kt | 50 +++++++++++++----- .../src/kotlin/deprecated/Deprecated.kt | 16 +++--- .../stdlib/src/kotlin/text/StringsJVM.kt | 20 +++---- .../src/templates/Sequence.kt | 2 + 5 files changed, 82 insertions(+), 58 deletions(-) diff --git a/libraries/stdlib/src/generated/_Sequences.kt b/libraries/stdlib/src/generated/_Sequences.kt index 2cd8cc72988..835eca74b85 100644 --- a/libraries/stdlib/src/generated/_Sequences.kt +++ b/libraries/stdlib/src/generated/_Sequences.kt @@ -161,7 +161,7 @@ public fun String.asSequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Array.sequence(): Sequence { return asSequence() } @@ -169,7 +169,7 @@ public fun Array.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun BooleanArray.sequence(): Sequence { return asSequence() } @@ -177,7 +177,7 @@ public fun BooleanArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun ByteArray.sequence(): Sequence { return asSequence() } @@ -185,7 +185,7 @@ public fun ByteArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun CharArray.sequence(): Sequence { return asSequence() } @@ -193,7 +193,7 @@ public fun CharArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun DoubleArray.sequence(): Sequence { return asSequence() } @@ -201,7 +201,7 @@ public fun DoubleArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun FloatArray.sequence(): Sequence { return asSequence() } @@ -209,7 +209,7 @@ public fun FloatArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun IntArray.sequence(): Sequence { return asSequence() } @@ -217,7 +217,7 @@ public fun IntArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun LongArray.sequence(): Sequence { return asSequence() } @@ -225,7 +225,7 @@ public fun LongArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun ShortArray.sequence(): Sequence { return asSequence() } @@ -233,7 +233,7 @@ public fun ShortArray.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Iterable.sequence(): Sequence { return asSequence() } @@ -241,7 +241,7 @@ public fun Iterable.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Map.sequence(): Sequence> { return asSequence() } @@ -249,7 +249,7 @@ public fun Map.sequence(): Sequence> { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Sequence.sequence(): Sequence { return this } @@ -258,7 +258,7 @@ public fun Sequence.sequence(): Sequence { /** * Returns a stream from the given collection */ -deprecated("Use asStream() instead") +deprecated("Use asStream() instead", ReplaceWith("asStream()")) public fun Stream.stream(): Stream { return this } @@ -266,7 +266,7 @@ public fun Stream.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun String.sequence(): Sequence { return asSequence() } @@ -274,7 +274,7 @@ public fun String.sequence(): Sequence { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Array.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -287,7 +287,7 @@ public fun Array.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun BooleanArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -300,7 +300,7 @@ public fun BooleanArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun ByteArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -313,7 +313,7 @@ public fun ByteArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun CharArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -326,7 +326,7 @@ public fun CharArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun DoubleArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -339,7 +339,7 @@ public fun DoubleArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun FloatArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -352,7 +352,7 @@ public fun FloatArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun IntArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -365,7 +365,7 @@ public fun IntArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun LongArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -378,7 +378,7 @@ public fun LongArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun ShortArray.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -391,7 +391,7 @@ public fun ShortArray.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Iterable.stream(): Stream { val sequence = asSequence() return object : Stream { @@ -404,7 +404,7 @@ public fun Iterable.stream(): Stream { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun Map.stream(): Stream> { val sequence = asSequence() return object : Stream> { @@ -417,7 +417,7 @@ public fun Map.stream(): Stream> { /** * Returns a sequence from the given collection */ -deprecated("Use asSequence() instead") +deprecated("Use asSequence() instead", ReplaceWith("asSequence()")) public fun String.stream(): Stream { val sequence = asSequence() return object : Stream { diff --git a/libraries/stdlib/src/kotlin/collections/Sequence.kt b/libraries/stdlib/src/kotlin/collections/Sequence.kt index 51a651e2e5b..7d9a1d1a6db 100644 --- a/libraries/stdlib/src/kotlin/collections/Sequence.kt +++ b/libraries/stdlib/src/kotlin/collections/Sequence.kt @@ -23,10 +23,10 @@ public fun Stream.toSequence(): Sequence = object : Sequence { override fun iterator(): Iterator = this@toSequence.iterator() } -deprecated("Use sequenceOf() instead") +deprecated("Use sequenceOf() instead", ReplaceWith("sequenceOf(*elements)")) public fun streamOf(vararg elements: T): Stream = elements.stream() -deprecated("Use sequenceOf() instead") +deprecated("Use sequenceOf() instead", ReplaceWith("sequenceOf(progression)")) public fun streamOf(progression: Progression): Stream = object : Stream { override fun iterator(): Iterator = progression.iterator() } @@ -48,7 +48,7 @@ public fun Iterator.sequence(): Sequence = asSequence() /** * Creates a sequence that returns all values from this enumeration. The sequence is constrained to be iterated only once. */ -public fun Enumeration.asSequence(): Sequence = this.iterator().sequence() +public fun Enumeration.asSequence(): Sequence = this.iterator().asSequence() /** * Creates a sequence that returns the specified values. @@ -133,7 +133,9 @@ public class TransformingStream(stream: Stream, transformer: (T) -> R) * in the underlying [sequence]. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.map() instead.") -public class TransformingSequence(private val sequence: Sequence, private val transformer: (T) -> R) : Sequence { +public class TransformingSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.map(transformer)")) +(private val sequence: Sequence, private val transformer: (T) -> R) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() override fun next(): R { @@ -156,7 +158,9 @@ public class TransformingIndexedStream(stream: Stream, transformer: (In * sequence along with the value itself. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.mapIndexed() instead.") -public class TransformingIndexedSequence(private val sequence: Sequence, private val transformer: (Int, T) -> R) : Sequence { +public class TransformingIndexedSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.mapIndexed(transformer)")) +(private val sequence: Sequence, private val transformer: (Int, T) -> R) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() var index = 0 @@ -179,7 +183,9 @@ public class IndexingStream(stream: Stream) * [IndexedValue] objects. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.withIndex() instead.") -public class IndexingSequence(private val sequence: Sequence) : Sequence> { +public class IndexingSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.withIndex()")) +(private val sequence: Sequence) : Sequence> { override fun iterator(): Iterator> = object : Iterator> { val iterator = sequence.iterator() var index = 0 @@ -203,7 +209,9 @@ public class MergingStream(stream1: Stream, stream2: Stream, * values as soon as one of the underlying sequences stops returning values. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.merge() instead.") -public class MergingSequence(private val sequence1: Sequence, +public class MergingSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence1.merge(sequence2, transform)")) + (private val sequence1: Sequence, private val sequence2: Sequence, private val transform: (T1, T2) -> V ) : Sequence { @@ -225,7 +233,9 @@ public class FlatteningStream(stream: Stream, transformer: (T) -> Strea : Stream by FlatteningSequence(stream.toSequence(), { transformer(it).toSequence() }) deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.flatMap() instead.") -public class FlatteningSequence(private val sequence: Sequence, +public class FlatteningSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.flatMap(transformer)")) + (private val sequence: Sequence, private val transformer: (T) -> Sequence ) : Sequence { override fun iterator(): Iterator = object : Iterator { @@ -268,7 +278,9 @@ public class Multistream(stream: Stream>) : Stream by FlatteningSequence(stream.toSequence(), { it.toSequence() }) deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.flatten() instead.") -public class MultiSequence(private val sequence: Sequence>) : Sequence { +public class MultiSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.flatten()")) +(private val sequence: Sequence>) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() var itemIterator: Iterator? = null @@ -313,7 +325,9 @@ public class TakeStream(stream: Stream, count: Int) * as soon as that count is reached. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.take() instead.") -public class TakeSequence(private val sequence: Sequence, +public class TakeSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.take(count)")) + (private val sequence: Sequence, private val count: Int ) : Sequence { init { @@ -345,7 +359,9 @@ public class TakeWhileStream(stream: Stream, predicate: (T) -> Boolean) : * `true`, and stops returning values once the function returns `false` for the next element. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.takeWhile() instead.") -public class TakeWhileSequence(private val sequence: Sequence, +public class TakeWhileSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.takeWhile(predicate)")) + (private val sequence: Sequence, private val predicate: (T) -> Boolean ) : Sequence { override fun iterator(): Iterator = object : Iterator { @@ -395,7 +411,9 @@ public class DropStream(stream: Stream, count: Int) * all values after that. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.drop() instead.") -public class DropSequence(private val sequence: Sequence, +public class DropSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.drop(count)")) + (private val sequence: Sequence, private val count: Int ) : Sequence { init { @@ -434,7 +452,9 @@ public class DropWhileStream(stream: Stream, predicate: (T) -> Boolean) : * all values after that. */ deprecated("This class is an implementation detail and shall be made internal soon. Use sequence.dropWhile() instead.") -public class DropWhileSequence(private val sequence: Sequence, +public class DropWhileSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence.dropWhile(predicate)")) + (private val sequence: Sequence, private val predicate: (T) -> Boolean ) : Sequence { @@ -507,7 +527,9 @@ private class DistinctIterator(private val source : Iterator, private v * `null` is returned from [producer]. */ deprecated("This class is an implementation detail and shall be made internal soon. Use function sequence(nextFunction: () -> T?) instead.") -public class FunctionSequence(private val producer: () -> T?) : Sequence { +public class FunctionSequence +deprecated("This class is an implementation detail and shall be made internal soon.", ReplaceWith("sequence(producer)")) +(private val producer: () -> T?) : Sequence { override fun iterator(): Iterator = object : Iterator { var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue var nextItem: T? = null diff --git a/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt b/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt index 4b048dcb5a4..2bfaf07990e 100644 --- a/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt +++ b/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt @@ -8,23 +8,23 @@ public inline fun Array.find(predicate: (T) -> Boolean): T? = firstOr deprecated("Use firstOrNull function instead.", ReplaceWith("firstOrNull(predicate)")) public inline fun Iterable.find(predicate: (T) -> Boolean): T? = firstOrNull(predicate) -deprecated("Use listOf(...) or arrayListOf(...) instead") +deprecated("Use listOf(...) or arrayListOf(...) instead", ReplaceWith("arrayListOf(*values)")) public fun arrayList(vararg values: T): ArrayList = arrayListOf(*values) -deprecated("Use setOf(...) or hashSetOf(...) instead") +deprecated("Use setOf(...) or hashSetOf(...) instead", ReplaceWith("hashSetOf(*values)")) public fun hashSet(vararg values: T): HashSet = hashSetOf(*values) -deprecated("Use mapOf(...) or hashMapOf(...) instead") +deprecated("Use mapOf(...) or hashMapOf(...) instead", ReplaceWith("hashMapOf(*values)")) public fun hashMap(vararg values: Pair): HashMap = hashMapOf(*values) -deprecated("Use listOf(...) or linkedListOf(...) instead") +deprecated("Use listOf(...) or linkedListOf(...) instead", ReplaceWith("linkedListOf(*values)")) public fun linkedList(vararg values: T): LinkedList = linkedListOf(*values) deprecated("Use linkedMapOf(...) instead", ReplaceWith("linkedMapOf(*values)")) public fun linkedMap(vararg values: Pair): LinkedHashMap = linkedMapOf(*values) /** Copies all characters into a [[Collection] */ -deprecated("Use toList() instead.") +deprecated("Use toList() instead.", ReplaceWith("toList()")) public fun String.toCollection(): Collection = toCollection(ArrayList(this.length())) /** @@ -32,7 +32,7 @@ public fun String.toCollection(): Collection = toCollection(ArrayList Boolean): Char? { for (c in this) if (predicate(c)) return c return null @@ -43,7 +43,7 @@ public inline fun String.find(predicate: (Char) -> Boolean): Char? { * * @includeFunctionBody ../../test/text/StringTest.kt findNot */ -deprecated("Use firstOrNull instead") +deprecated("Use firstOrNull instead with negated predicate") public inline fun String.findNot(predicate: (Char) -> Boolean): Char? { for (c in this) if (!predicate(c)) return c return null @@ -122,7 +122,7 @@ public val List.first: T? * * @includeFunctionBody ../../test/collections/ListSpecificTest.kt last */ -deprecated("Use lastOrNull() function instead") +deprecated("Use lastOrNull() function instead", ReplaceWith("this.lastOrNull()")) public val List.last: T? get() { val s = this.size() diff --git a/libraries/stdlib/src/kotlin/text/StringsJVM.kt b/libraries/stdlib/src/kotlin/text/StringsJVM.kt index 9dd5e9d0b84..030c12497b4 100644 --- a/libraries/stdlib/src/kotlin/text/StringsJVM.kt +++ b/libraries/stdlib/src/kotlin/text/StringsJVM.kt @@ -87,7 +87,7 @@ public fun String.replaceFirstLiteral(oldValue: String, newValue: String, ignore * Returns a new string obtained by replacing each substring of this string that matches the given regular expression * with the given [replacement]. */ -deprecated("Use String.replace(Regex, String) instead. You can convert regex parameter with .toRegex() extension function.") +deprecated("Use String.replace(Regex, String) instead. You can convert regex parameter with .toRegex() extension function.", ReplaceWith("replace(regex.toRegex(), replacement)")) public fun String.replaceAll(regex: String, replacement: String): String = (this as java.lang.String).replaceAll(regex, replacement) /** @@ -130,13 +130,13 @@ public fun String.split(regex: Pattern, limit: Int = 0): List /** * Splits this string around matches of the given regular expression. */ -deprecated("Convert String argument to regex with toRegex or use splitBy instead.") +deprecated("Convert String argument to regex with toRegex or use splitBy instead. Please note the change of return type and empty elements handling.") public fun String.split(regex: String): Array = (this as java.lang.String).split(regex) /** * Splits this string into at most [limit] chunks around matches of the given regular expression. */ -deprecated("Convert String argument to regex with toRegex or use splitBy instead.") +deprecated("Convert String argument to regex with toRegex or use splitBy instead. Please note the change of return type and limit parameter restrictions.") public fun String.split(regex: String, limit: Int): Array = (this as java.lang.String).split(regex, limit) /** @@ -259,7 +259,7 @@ public fun String(stringBuilder: java.lang.StringBuilder): String = java.lang.St /** * Replaces the first substring of this string that matches the given regular expression with the given replacement. */ -deprecated("Use replaceFirst(Regex, String) or replaceFirstLiteral(String, String) instead.") +deprecated("Use replaceFirst(Regex, String) or replaceFirstLiteral(String, String) instead.", ReplaceWith("replaceFirst(regex.toRegex(), replacement)")) public fun String.replaceFirst(regex: String, replacement: String): String = (this as java.lang.String).replaceFirst(regex, replacement) /** @@ -280,7 +280,7 @@ public fun String.codePointCount(beginIndex: Int, endIndex: Int): Int = (this as /** * Compares two strings lexicographically, ignoring case differences. */ -deprecated("Use compareTo with true passed to ignoreCase parameter.") +deprecated("Use compareTo with true passed to ignoreCase parameter.", ReplaceWith("compareTo(str, ignoreCase = true)")) public fun String.compareToIgnoreCase(str: String): Int = (this as java.lang.String).compareToIgnoreCase(str) /** @@ -331,7 +331,7 @@ public fun String.isBlank(): Boolean = length() == 0 || all { it.isWhitespace() /** * Returns `true` if this string matches the given regular expression. */ -deprecated("Use String.matches(Regex) instead. You can convert regex parameter with .toRegex() extension function.") +deprecated("Use String.matches(Regex) instead. You can convert regex parameter with .toRegex() extension function.", ReplaceWith("matches(regex.toRegex())")) public fun String.matches(regex: String): Boolean = (this as java.lang.String).matches(regex) /** @@ -347,7 +347,7 @@ public fun String.offsetByCodePoints(index: Int, codePointOffset: Int): Int = (t * @param ooffset the start offset in the other string of the substring to compare. * @param len the length of the substring to compare. */ -deprecated("Use regionMatches overload with ignoreCase as optional last parameter.") +deprecated("Use regionMatches overload with ignoreCase as optional last parameter.", ReplaceWith("regionMatches(toffset, other, ooffset, len, ignoreCase)")) public fun String.regionMatches(ignoreCase: Boolean, toffset: Int, other: String, ooffset: Int, len: Int): Boolean = (this as java.lang.String).regionMatches(ignoreCase, toffset, other, ooffset, len) /** @@ -431,13 +431,13 @@ public fun String.toByteArray(charset: String): ByteArray = (this as java.lang.S */ public fun String.toByteArray(charset: Charset = Charsets.UTF_8): ByteArray = (this as java.lang.String).getBytes(charset) -deprecated("Use toByteArray() instead to emphasize copy behaviour") +deprecated("Use toByteArray() instead to emphasize copy behaviour", ReplaceWith("toByteArray()")) public fun String.getBytes(): ByteArray = (this as java.lang.String).getBytes() -deprecated("Use toByteArray(charset) instead to emphasize copy behaviour") +deprecated("Use toByteArray(charset) instead to emphasize copy behaviour", ReplaceWith("toByteArray(charset)")) public fun String.getBytes(charset: Charset): ByteArray = (this as java.lang.String).getBytes(charset) -deprecated("Use toByteArray(charset) instead to emphasize copy behaviour") +deprecated("Use toByteArray(charset) instead to emphasize copy behaviour", ReplaceWith("toByteArray(charset)")) public fun String.getBytes(charset: String): ByteArray = (this as java.lang.String).getBytes(charset) /** diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt index 480175ea5f3..3d26075baf4 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt @@ -10,6 +10,7 @@ fun sequences(): List { exclude(Sequences) deprecate { "Use asSequence() instead" } doc { "Returns a sequence from the given collection" } + deprecateReplacement { "asSequence()" } returns("Stream") body { """ @@ -28,6 +29,7 @@ fun sequences(): List { include(Maps) exclude(Sequences) deprecate { "Use asSequence() instead" } + deprecateReplacement { "asSequence()" } doc { "Returns a sequence from the given collection" } returns("Sequence") body {