Files
kotlin/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt
2019-11-19 11:00:09 +03:00

14 lines
329 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
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"
}