From cbf8dca28db37f30a54120261e7ac304fe3b9290 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Mon, 28 Mar 2016 18:22:05 +0300 Subject: [PATCH] Add deprecated extension MutableList.remove. #KT-11648 Fixed --- .../stdlib/src/kotlin/collections/MutableCollections.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt index 83525fbac18..7ae71903e04 100644 --- a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt +++ b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt @@ -39,6 +39,14 @@ public inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.r public inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.retainAll(elements: Collection): Boolean = @Suppress("UNCHECKED_CAST") (this as MutableCollection).retainAll(elements) +/** + * Removes the element at the specified [index] from this list. + * In Kotlin one should use the [MutableList.removeAt] function instead. + */ +@Deprecated("Use removeAt(index) instead.", ReplaceWith("removeAt(index)"), level = DeprecationLevel.ERROR) +@kotlin.internal.InlineOnly +public inline fun MutableList.remove(index: Int): T = removeAt(index) + /** * Adds the specified [element] to this mutable collection. */