Fix for KT-12125: Wrong increment/decrement on Byte/Char/Short.MAX_VALUE/MIN_VALUE

#KT-12125 Fixed
This commit is contained in:
Mikhael Bogdanov
2016-05-10 15:49:22 +03:00
parent 8425304866
commit d6a64af929
8 changed files with 98 additions and 12 deletions
+16
View File
@@ -0,0 +1,16 @@
fun box(): String {
var aByte: Byte? = 0
var bByte: Byte = 0
if (aByte != null) aByte--
bByte--
if (aByte != bByte) return "Failed post-decrement Byte: $aByte != $bByte"
if (aByte != null) aByte++
bByte++
if (aByte != bByte) return "Failed post-increment Byte: $aByte != $bByte"
aByte = null
return "OK"
}