Deprecate floating point to integral types lesser than Int #KT-30360

This commit is contained in:
Abduqodiri Qurbonzoda
2020-01-17 06:07:49 +03:00
parent e459542e6f
commit 1203df7405
14 changed files with 255 additions and 32 deletions
+4 -4
View File
@@ -459,7 +459,7 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Double>
public final operator fun times(other: R|kotlin/Short|): R|kotlin/Double|
public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(expression = String(toInt().toByte()))) public open fun toByte(): R|kotlin/Byte|
public open fun toChar(): R|kotlin/Char|
@@ -471,7 +471,7 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Double>
public open fun toLong(): R|kotlin/Long|
public open fun toShort(): R|kotlin/Short|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(expression = String(toInt().toShort()))) public open fun toShort(): R|kotlin/Short|
public final operator fun unaryMinus(): R|kotlin/Double|
@@ -642,7 +642,7 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Float>|
public final operator fun times(other: R|kotlin/Short|): R|kotlin/Float|
public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(expression = String(toInt().toByte()))) public open fun toByte(): R|kotlin/Byte|
public open fun toChar(): R|kotlin/Char|
@@ -654,7 +654,7 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Float>|
public open fun toLong(): R|kotlin/Long|
public open fun toShort(): R|kotlin/Short|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(expression = String(toInt().toShort()))) public open fun toShort(): R|kotlin/Short|
public final operator fun unaryMinus(): R|kotlin/Float|
@@ -14,7 +14,7 @@
* limitations under the License.
*/
@file:Suppress("DEPRECATION_ERROR")
@file:Suppress("DEPRECATION", "DEPRECATION_ERROR")
package org.jetbrains.kotlin.resolve.constants.evaluate
+4 -4
View File
@@ -277,13 +277,13 @@ public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double> {
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Double
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Double
public final operator fun unaryPlus(): kotlin.Double
@@ -380,13 +380,13 @@ public final class Float : kotlin.Number, kotlin.Comparable<kotlin.Float> {
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Float
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Float
public final operator fun unaryPlus(): kotlin.Float
+4 -4
View File
@@ -287,13 +287,13 @@ public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double>, jav
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Double
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Double
public final operator fun unaryPlus(): kotlin.Double
@@ -393,13 +393,13 @@ public final class Float : kotlin.Number, kotlin.Comparable<kotlin.Float>, java.
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Float
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Float
public final operator fun unaryPlus(): kotlin.Float
+4 -4
View File
@@ -289,13 +289,13 @@ public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double>, jav
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Double
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Double
public final operator fun unaryPlus(): kotlin.Double
@@ -395,13 +395,13 @@ public final class Float : kotlin.Number, kotlin.Comparable<kotlin.Float>, java.
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Float
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Float
public final operator fun unaryPlus(): kotlin.Float
+4 -4
View File
@@ -287,13 +287,13 @@ public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double>, jav
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Double
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Double
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Double
public final operator fun unaryPlus(): kotlin.Double
@@ -393,13 +393,13 @@ public final class Float : kotlin.Number, kotlin.Comparable<kotlin.Float>, java.
public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Float
public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Float
public open override /*1*/ fun toByte(): kotlin.Byte
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toByte()", imports = {})) public open override /*1*/ fun toByte(): kotlin.Byte
public open override /*1*/ fun toChar(): kotlin.Char
public open override /*1*/ fun toDouble(): kotlin.Double
public open override /*1*/ fun toFloat(): kotlin.Float
public open override /*1*/ fun toInt(): kotlin.Int
public open override /*1*/ fun toLong(): kotlin.Long
public open override /*1*/ fun toShort(): kotlin.Short
@kotlin.Deprecated(message = "Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", replaceWith = kotlin.ReplaceWith(expression = "toInt().toShort()", imports = {})) public open override /*1*/ fun toShort(): kotlin.Short
public final operator fun unaryMinus(): kotlin.Float
public final operator fun unaryPlus(): kotlin.Float
@@ -63,8 +63,8 @@ private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
unaryOperation(DOUBLE, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toShort", { a -> a.toShort() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toByte", { a -> a.toByte() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toShort", { a -> a.<!DEPRECATION!>toShort<!>() }, emptyUnaryFun),
unaryOperation(DOUBLE, "toByte", { a -> a.<!DEPRECATION!>toByte<!>() }, emptyUnaryFun),
unaryOperation(FLOAT, "toInt", { a -> a.toInt() }, emptyUnaryFun),
unaryOperation(FLOAT, "minus", { a -> a.unaryMinus() }, emptyUnaryFun),
unaryOperation(FLOAT, "toChar", { a -> a.toChar() }, emptyUnaryFun),
@@ -72,8 +72,8 @@ private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
unaryOperation(FLOAT, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
unaryOperation(FLOAT, "toFloat", { a -> a.toFloat() }, emptyUnaryFun),
unaryOperation(FLOAT, "toDouble", { a -> a.toDouble() }, emptyUnaryFun),
unaryOperation(FLOAT, "toShort", { a -> a.toShort() }, emptyUnaryFun),
unaryOperation(FLOAT, "toByte", { a -> a.toByte() }, emptyUnaryFun),
unaryOperation(FLOAT, "toShort", { a -> a.<!DEPRECATION!>toShort<!>() }, emptyUnaryFun),
unaryOperation(FLOAT, "toByte", { a -> a.<!DEPRECATION!>toByte<!>() }, emptyUnaryFun),
unaryOperation(INT, "plus", { a -> a.unaryPlus() }, emptyUnaryFun),
unaryOperation(INT, "toShort", { a -> a.toShort() }, emptyUnaryFun),
unaryOperation(INT, "toByte", { a -> a.toByte() }, emptyUnaryFun),