Create deprecated MutableList.sort extensions to guide how to replace them.

#KT-15790 Fixed
This commit is contained in:
Ilya Gorbunov
2017-01-18 21:16:49 +03:00
parent 6e2ebaa300
commit 3a1ed41436
3 changed files with 21 additions and 4 deletions
@@ -45,6 +45,16 @@ public inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection<out T>.r
@kotlin.internal.InlineOnly
public inline fun <T> MutableList<T>.remove(index: Int): T = removeAt(index)
@Deprecated("Use sortWith(comparator) instead.", ReplaceWith("this.sortWith(comparator)"), level = DeprecationLevel.ERROR)
@JvmVersion
@kotlin.internal.InlineOnly
public inline fun <T> MutableList<T>.sort(comparator: Comparator<in T>): Unit = throw NotImplementedError()
@Deprecated("Use sortWith(Comparator(comparison)) instead.", ReplaceWith("this.sortWith(Comparator(comparison))"), level = DeprecationLevel.ERROR)
@JvmVersion
@kotlin.internal.InlineOnly
public inline fun <T> MutableList<T>.sort(comparison: (T, T) -> Int): Unit = throw NotImplementedError()
/**
* Adds the specified [element] to this mutable collection.
*/