Hide deprecated Double/FloatArray.contains/indexOf/lastIndexOf

This commit is contained in:
Ilya Gorbunov
2022-04-08 14:08:14 +03:00
committed by Space
parent b35c571a23
commit 1845e326d1
6 changed files with 41 additions and 43 deletions
@@ -870,8 +870,8 @@ public final class kotlin/collections/ArraysKt {
public static synthetic fun binarySearch$default ([SSIIILjava/lang/Object;)I
public static final fun contains ([BB)Z
public static final fun contains ([CC)Z
public static final fun contains ([DD)Z
public static final fun contains ([FF)Z
public static final synthetic fun contains ([DD)Z
public static final synthetic fun contains ([FF)Z
public static final fun contains ([II)Z
public static final fun contains ([JJ)Z
public static final fun contains ([Ljava/lang/Object;Ljava/lang/Object;)Z
@@ -1223,8 +1223,8 @@ public final class kotlin/collections/ArraysKt {
public static final fun groupingBy ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/collections/Grouping;
public static final fun indexOf ([BB)I
public static final fun indexOf ([CC)I
public static final fun indexOf ([DD)I
public static final fun indexOf ([FF)I
public static final synthetic fun indexOf ([DD)I
public static final synthetic fun indexOf ([FF)I
public static final fun indexOf ([II)I
public static final fun indexOf ([JJ)I
public static final fun indexOf ([Ljava/lang/Object;Ljava/lang/Object;)I
@@ -1313,8 +1313,8 @@ public final class kotlin/collections/ArraysKt {
public static final fun last ([ZLkotlin/jvm/functions/Function1;)Z
public static final fun lastIndexOf ([BB)I
public static final fun lastIndexOf ([CC)I
public static final fun lastIndexOf ([DD)I
public static final fun lastIndexOf ([FF)I
public static final synthetic fun lastIndexOf ([DD)I
public static final synthetic fun lastIndexOf ([FF)I
public static final fun lastIndexOf ([II)I
public static final fun lastIndexOf ([JJ)I
public static final fun lastIndexOf ([Ljava/lang/Object;Ljava/lang/Object;)I
@@ -45,11 +45,11 @@ object Elements : TemplateGroupBase() {
doc { "Returns `true` if [element] is found in the ${f.collection}." }
typeParam("@kotlin.internal.OnlyInputTypes T")
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val isDeprecated = f == ArraysOfPrimitives && primitive!!.isFloatingPoint()
if (isDeprecated) {
val replacement = "any { it == element }"
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6"))
annotation("""@Suppress("DEPRECATION_ERROR")""")
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6", hiddenSince = "1.7"))
}
returns("Boolean")
body(Iterables) {
@@ -59,6 +59,7 @@ object Elements : TemplateGroupBase() {
return indexOf(element) >= 0
"""
}
if (!isDeprecated)
body(ArraysOfPrimitives, ArraysOfObjects, Sequences) {
"""
return indexOf(element) >= 0
@@ -77,7 +78,7 @@ object Elements : TemplateGroupBase() {
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val replacement = "indexOfFirst { it == element }"
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6"))
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6", hiddenSince = "1.7"))
}
returns("Int")
body {
@@ -142,7 +143,7 @@ object Elements : TemplateGroupBase() {
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val replacement = "indexOfLast { it == element }"
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6"))
deprecate(Deprecation(message, replacement, warningSince = "1.4", errorSince = "1.6", hiddenSince = "1.7"))
}
returns("Int")
body {