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

(cherry picked from commit 1df1be0ad950873051598a70c3309520457e1ccd)
This commit is contained in:
Abduqodiri Qurbonzoda
2020-01-17 21:16:08 +03:00
committed by Vasily Levchenko
parent 3546ad5e72
commit 757dd67b98
@@ -1333,6 +1333,7 @@ public final 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 = this.toInt().toByte()
/**
@@ -1347,6 +1348,7 @@ public final 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 = this.toInt().toShort()
/**
@@ -1592,6 +1594,7 @@ public final 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 = this.toInt().toByte()
/**
@@ -1606,6 +1609,7 @@ public final 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 = this.toInt().toShort()
/**