Files
kotlin/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt
2017-12-14 10:41:51 +03:00

14 lines
296 B
Kotlin
Vendored

// WITH_RUNTIME
const val M = Int.MAX_VALUE
fun box(): String {
var step = 0
for (i in (M .. M).reversed()) {
++step
if (step > 1) throw AssertionError("Should be executed once")
}
if (step != 1) throw AssertionError("Should be executed once")
return "OK"
}