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
@@ -1144,6 +1144,7 @@ public class Float private constructor() : Number(), Comparable<Float> {
*
* The resulting `Byte` value is equal to `this.toInt().toByte()`.
*/
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()"))
public override fun toByte(): Byte
/**
* Converts this [Float] value to [Char].
@@ -1156,6 +1157,7 @@ public class Float private constructor() : Number(), Comparable<Float> {
*
* The resulting `Short` value is equal to `this.toInt().toShort()`.
*/
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()"))
public override fun toShort(): Short
/**
* Converts this [Float] value to [Int].
@@ -1362,6 +1364,7 @@ public class Double private constructor() : Number(), Comparable<Double> {
*
* The resulting `Byte` value is equal to `this.toInt().toByte()`.
*/
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()"))
public override fun toByte(): Byte
/**
* Converts this [Double] value to [Char].
@@ -1374,6 +1377,7 @@ public class Double private constructor() : Number(), Comparable<Double> {
*
* The resulting `Short` value is equal to `this.toInt().toShort()`.
*/
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()"))
public override fun toShort(): Short
/**
* Converts this [Double] value to [Int].