Provide deprecated unconstrained contains, indexOf, lastIndexOf methods for migration.
This commit is contained in:
@@ -435,6 +435,16 @@ public operator fun ShortArray.contains(element: Short): Boolean {
|
||||
return indexOf(element) >= 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if [element] is found in the collection.
|
||||
*/
|
||||
@Deprecated("Use 'containsRaw' instead.", ReplaceWith("containsRaw(element)"))
|
||||
@kotlin.jvm.JvmName("containsAny")
|
||||
@kotlin.internal.LowPriorityInOverloadResolution
|
||||
public operator fun <T> Array<out T>.contains(element: T): Boolean {
|
||||
return containsRaw(element)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if [element] is found in the collection.
|
||||
* Allows to overcome type-safety restriction of `contains` that requires to pass an element of type `T`.
|
||||
@@ -1307,6 +1317,17 @@ public fun ShortArray.indexOf(element: Short): Int {
|
||||
return -1
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns first index of [element], or -1 if the collection does not contain element.
|
||||
*/
|
||||
@Deprecated("Use 'indexOfRaw' instead.", ReplaceWith("indexOfRaw(element)"))
|
||||
@kotlin.jvm.JvmName("indexOfAny")
|
||||
@kotlin.internal.LowPriorityInOverloadResolution
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
public fun <T> Array<out T>.indexOf(element: T): Int {
|
||||
return indexOfRaw(element)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element.
|
||||
*/
|
||||
@@ -1846,6 +1867,17 @@ public fun ShortArray.lastIndexOf(element: Short): Int {
|
||||
return -1
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns last index of [element], or -1 if the collection does not contain element.
|
||||
*/
|
||||
@Deprecated("Use 'indexOfRaw' instead.", ReplaceWith("indexOfRaw(element)"))
|
||||
@kotlin.jvm.JvmName("lastIndexOfAny")
|
||||
@kotlin.internal.LowPriorityInOverloadResolution
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
public fun <T> Array<out T>.lastIndexOf(element: T): Int {
|
||||
return indexOfRaw(element)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns last index of [element], or -1 if the collection does not contain element.
|
||||
* Allows to overcome type-safety restriction of `lastIndexOf` that requires to pass an element of type `T`.
|
||||
|
||||
Reference in New Issue
Block a user