diff --git a/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt b/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt index c0c52931ce9..3c6838ba513 100644 --- a/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt +++ b/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt @@ -36,6 +36,18 @@ public fun MutableList.remove(index: Int): E = removeAt(index) @Deprecated("Use explicit cast to MutableCollection instead", ReplaceWith("(this as MutableCollection).remove(o)")) public fun MutableCollection.remove(o: Any?): Boolean = remove(o as E) +@Deprecated("Use explicit cast to MutableCollection instead", ReplaceWith("(this as MutableCollection).removeAll(c)")) +public fun MutableCollection.removeAll(c: Collection): Boolean = removeAll(c as Collection) + +@Deprecated("Use explicit cast to MutableCollection instead", ReplaceWith("(this as MutableCollection).retainAll(c)")) +public fun MutableCollection.retainAll(c: Collection): Boolean = retainAll(c as Collection) + +@Deprecated("Use explicit cast to List instead", ReplaceWith("(this as List).indexOf(o)")) +public fun List.indexOf(o: Any?): Int = indexOf(o as E) + +@Deprecated("Use explicit cast to List instead", ReplaceWith("(this as List).lastIndexOf(o)")) +public fun List.lastIndexOf(o: Any?): Int = lastIndexOf(o as E) + @Deprecated("Use property 'length' instead", ReplaceWith("this.length")) public fun CharSequence.length(): Int = length diff --git a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt index 1691e95d185..e80ef670b2d 100644 --- a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt +++ b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt @@ -6,18 +6,6 @@ package kotlin @Deprecated("Use operator 'get' instead", ReplaceWith("this[index]")) public fun CharSequence.charAt(index: Int): Char = this[index] -@Deprecated("Use explicit cast to MutableCollection instead", ReplaceWith("(this as MutableCollection).removeAll(c)")) -public fun MutableCollection.removeAll(c: Collection): Boolean = removeAll(c as Collection) - -@Deprecated("Use explicit cast to MutableCollection instead", ReplaceWith("(this as MutableCollection).retainAll(c)")) -public fun MutableCollection.retainAll(c: Collection): Boolean = retainAll(c as Collection) - -@Deprecated("Use explicit cast to List instead", ReplaceWith("(this as List).indexOf(o)")) -public fun List.indexOf(o: Any?): Int = indexOf(o as E) - -@Deprecated("Use explicit cast to List instead", ReplaceWith("(this as List).lastIndexOf(o)")) -public fun List.lastIndexOf(o: Any?): Int = lastIndexOf(o as E) - /** * Adds the specified [element] to this mutable collection. */