Fix double "deprecated" annotation in generated sources which confuses DX compiler.

This commit is contained in:
Ilya Ryzhenkov
2015-03-13 19:30:28 +03:00
parent df2d2dc21a
commit 4fa5d9cb48
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -851,7 +851,7 @@ public inline fun <T> Sequence<T>.first(predicate: (T) -> Boolean): T {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* "Returns the first element matching the given [predicate].
* Returns the first element matching the given [predicate].
* @throws NoSuchElementException if no such element is found.
*/
public inline fun <T> Stream<T>.first(predicate: (T) -> Boolean): T {
@@ -1098,7 +1098,7 @@ public inline fun <T> Sequence<T>.firstOrNull(predicate: (T) -> Boolean): T? {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns first element matching the given [predicate], or `null` if element was not found
* Returns the first element matching the given [predicate], or `null` if element was not found
*/
public inline fun <T> Stream<T>.firstOrNull(predicate: (T) -> Boolean): T? {
for (element in this) if (predicate(element)) return element
@@ -1284,7 +1284,6 @@ public fun <T> Sequence<T>.withIndices(): Sequence<Pair<Int, T>> {
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing pairs of each element of the original collection and their index
*/
@@ -174,7 +174,8 @@ class GenericFunction(val signature: String, val keyword: String = "fun") : Comp
}.toString()
builder.append(text)
builder.appendln()
builder.appendln("deprecated(\"Migrate to using Sequence<T> and respective functions\")")
if (deprecates[f] == null && deprecate.isEmpty())
builder.appendln("deprecated(\"Migrate to using Sequence<T> and respective functions\")")
val streamText = text
.replace("Sequence", "Stream")
.replace("sequence", "stream")