Files
kotlin/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt
2018-10-01 12:25:55 +03:00

13 lines
299 B
Kotlin
Vendored

const val M = Long.MAX_VALUE
fun box(): String {
var count = 0
for (i in M .. M) {
++count
if (count > 1) {
throw AssertionError("Loop should be executed once")
}
}
if (count != 1) throw AssertionError("Should be executed once")
return "OK"
}