Better replacement for containsAll, removeAll, retainAll with incompatible types.

This commit is contained in:
Ilya Gorbunov
2015-12-01 20:35:46 +03:00
parent 2821448dd8
commit b7a50b333e
@@ -13,10 +13,10 @@ import java.util.*
public fun <@kotlin.internal.OnlyInputTypes T> Collection<T>.containsAll(elements: Collection<T>): Boolean = this.containsAll(elements)
@Suppress("NOTHING_TO_INLINE")
@Deprecated("Collections have incompatible types. Upcast either to Collection<Any?> if you're sure.", ReplaceWith("containsAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast either to Collection<Any?> if you're sure.", ReplaceWith("containsAll<Any?>(elements)"))
public inline fun Collection<*>.containsAllRaw(elements: Collection<Any?>): Boolean = containsAll(elements)
@Deprecated("Collections have incompatible types. Upcast either to Collection<Any?> if you're sure.", ReplaceWith("containsAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast either to Collection<Any?> if you're sure.", ReplaceWith("containsAll<Any?>(elements)"))
@kotlin.jvm.JvmName("containsAllOfAny")
@kotlin.internal.LowPriorityInOverloadResolution
public fun <E> Collection<E>.containsAll(elements: Collection<Any?>): Boolean = containsAll(elements)
@@ -50,10 +50,10 @@ public fun <T> MutableCollection<out T>.remove(element: T): Boolean = remove(ele
public fun <@kotlin.internal.OnlyInputTypes T> MutableCollection<out T>.removeAll(elements: Collection<T>): Boolean = (this as MutableCollection<T>).removeAll(elements)
@Suppress("NOTHING_TO_INLINE")
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("removeAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("removeAll<Any?>(elements)"))
public inline fun <E> MutableCollection<E>.removeAllRaw(elements: Collection<Any?>): Boolean = removeAll(elements)
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("removeAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("removeAll<Any?>(elements)"))
@kotlin.jvm.JvmName("removeAllOfAny")
@kotlin.internal.LowPriorityInOverloadResolution
public fun <E> MutableCollection<E>.removeAll(elements: Collection<Any?>): Boolean = removeAll(elements)
@@ -68,10 +68,10 @@ public fun <E> MutableCollection<E>.removeAll(elements: Collection<Any?>): Boole
public fun <@kotlin.internal.OnlyInputTypes T> MutableCollection<out T>.retainAll(elements: Collection<T>): Boolean = (this as MutableCollection<T>).retainAll(elements)
@Suppress("NOTHING_TO_INLINE")
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("retainAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("retainAll<Any?>(elements)"))
public inline fun <E> MutableCollection<E>.retainAllRaw(elements: Collection<Any?>): Boolean = retainAll(elements)
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("retainAll(elements as Collection<Any?>)"))
@Deprecated("Collections have incompatible types. Upcast elements to Collection<Any?> if you're sure.", ReplaceWith("retainAll<Any?>(elements)"))
@kotlin.jvm.JvmName("retainAllOfAny")
@kotlin.internal.LowPriorityInOverloadResolution
public fun <E> MutableCollection<E>.retainAll(elements: Collection<Any?>): Boolean = retainAll(elements as Collection<Any?>)