Mark with @DeprecatedSinceKotlin #KT-22423 and #KT-28753

This commit is contained in:
Abduqodiri Qurbonzoda
2020-07-16 05:38:32 +03:00
parent 87cb6372a0
commit a05681001f
8 changed files with 122 additions and 52 deletions
@@ -40,7 +40,8 @@ object Elements : TemplateGroupBase() {
typeParam("@kotlin.internal.OnlyInputTypes T")
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val replacement = "any { it == element }"
deprecate(Deprecation(floatingSearchDeprecationMessage(signature, replacement), replacement, DeprecationLevel.WARNING))
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4"))
annotation("""@Suppress("DEPRECATION")""")
}
returns("Boolean")
@@ -68,7 +69,8 @@ object Elements : TemplateGroupBase() {
}
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val replacement = "indexOfFirst { it == element }"
deprecate(Deprecation(floatingSearchDeprecationMessage(signature, replacement), replacement, DeprecationLevel.WARNING))
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4"))
}
returns("Int")
body {
@@ -132,7 +134,8 @@ object Elements : TemplateGroupBase() {
}
if (f == ArraysOfPrimitives && primitive!!.isFloatingPoint()) {
val replacement = "indexOfLast { it == element }"
deprecate(Deprecation(floatingSearchDeprecationMessage(signature, replacement), replacement, DeprecationLevel.WARNING))
val message = floatingSearchDeprecationMessage(signature, replacement)
deprecate(Deprecation(message, replacement, warningSince = "1.4"))
}
returns("Int")
body {
@@ -159,7 +159,8 @@ object RangeOps : TemplateGroupBase() {
check(rangeType.isNumeric() == itemType.isNumeric()) { "Required rangeType and itemType both to be numeric or both not, got: $rangeType, $itemType" }
if (rangeType.isIntegral() != itemType.isIntegral()) {
deprecate(Deprecation("This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.", level = DeprecationLevel.ERROR))
val message = "This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed."
deprecate(Deprecation(message, warningSince = "1.3", errorSince = "1.4"))
}
platformName("${rangeType.name.decapitalize()}RangeContains")