JS: support integer overflow semantics for unary minus operator

See KT-19290
This commit is contained in:
Alexey Andreev
2017-10-17 11:56:11 +03:00
parent f25a5b5177
commit d4ea4983d8
2 changed files with 24 additions and 1 deletions
+6 -1
View File
@@ -26,5 +26,10 @@ fun box(): String {
v = bigValue() * bigValue()
if (v != 16) return "fail6: $v"
v = -minInt()
if (v != Int.MIN_VALUE) return "fail7: $v"
return "OK"
}
}
fun minInt() = Int.MIN_VALUE