Sign in
◑
Theme
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
21de67cac1bef9259daa407b68a12e178923aef3
/
.
/
compiler
/
testData
/
codegen
/
box
/
binaryOp
/
overflowChar.kt
blob: 0f06f4969fde028a341ae4626bcc6376db1e8422 [
file
]
fun box
():
String
{
val c1
:
Char
=
0.toChar
()
val c2
=
c1
-
1
if
(
c2
<
c1
)
return
"fail: 0.toChar() - 1 should overflow to positive."
val c3
=
c2
+
1
if
(
c3
>
c2
)
return
"fail: FFFF.toChar() + 1 should overflow to zero."
return
"OK"
}