Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360

This commit is contained in:
Abduqodiri Qurbonzoda
2021-03-27 03:03:55 +03:00
parent 404c69ded7
commit 968099fbec
23 changed files with 64 additions and 76 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ fun box() : String {
assertEquals(1.toByte(), foo(1L) { x -> x!!.toByte() })
assertEquals(1.toShort(), foo(1L) { x -> x!!.toShort() })
assertEquals('a'.toDouble(), foo('a') { x -> x!!.toDouble() })
assertEquals(1.0.toByte(), foo(1.0) { x -> x!!.toByte() })
assertEquals(1.0.toInt(), foo(1.0) { x -> x!!.toInt() })
return "OK"
}
@@ -42,13 +42,9 @@ fun box(): String {
65534.0, 65535.0, 65536.0,
2147483647.0, 2147483648.0, 2147483649.0,
Double.MAX_VALUE, Double.POSITIVE_INFINITY)) {
assertEquals(d.toInt().toByte(), d.toByte())
assertEquals(d.toInt().toShort(), d.toShort())
assertEquals(d.toInt().toChar(), d.toChar())
val f = d.toFloat()
assertEquals(f.toInt().toByte(), f.toByte())
assertEquals(f.toInt().toShort(), f.toShort())
assertEquals(f.toInt().toChar(), f.toChar())
}
@@ -9,7 +9,7 @@ fun bar() {
foo(1L) { x -> x!!.toByte() }
foo(1L) { x -> x!!.toShort() }
foo('a') { x -> x!!.toDouble() }
foo(1.0) { x -> x!!.toByte() }
foo(1.0) { x -> x!!.toInt() }
}
// 0 valueOf
@@ -17,6 +17,6 @@ fun bar() {
// 1 I2L
// 2 L2I
// 2 I2S
// 2 I2B
// 1 I2B
// 1 I2D
// 1 D2I