Deprecate floating point to integral types lesser than Int #KT-30360
(cherry picked from commit 1df1be0ad950873051598a70c3309520457e1ccd)
This commit is contained in:
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()`.
|
* 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()
|
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()`.
|
* 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()
|
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()`.
|
* 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()
|
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()`.
|
* 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()
|
public override fun toShort(): Short = this.toInt().toShort()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user