Make unary minus and unary plus return int for byte and short

This commit is contained in:
Natalia Ukhorskaya
2013-12-19 17:42:28 +04:00
parent 802c1b772f
commit 4329c42e3f
23 changed files with 76 additions and 68 deletions
@@ -25,13 +25,13 @@ fun box(): Boolean {
if (cn.toFloat() != -3.6.toFloat()) {
return false
}
if (cn.toByte() != -3.toByte()) {
if (cn.toByte() != (-3).toByte()) {
return false
}
if (cn.toInt() != -3) {
return false
}
if (cn.toShort() != -3.toShort()) {
if (cn.toShort() != (-3).toShort()) {
return false
}
@@ -59,13 +59,13 @@ fun box(): Boolean {
if (fn.toFloat() != -3.6.toFloat()) {
return false
}
if (fn.toByte() != -3.toByte()) {
if (fn.toByte() != (-3).toByte()) {
return false
}
if (fn.toInt() != -3) {
return false
}
if (fn.toShort() != -3.toShort()) {
if (fn.toShort() != (-3).toShort()) {
return false
}
return true
@@ -18,7 +18,7 @@ fun box(): Boolean {
return false
}
val c2: Int = -5
if (c2.toShort() != -5.toShort()) {
if (c2.toShort() != (-5).toShort()) {
return false
}
if (c2.toFloat() != -5.toFloat()) {