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

22 lines
370 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
fun box(): String {
testIntInIntUntilSmartcastInt()
return "OK"
}
private fun testIntInIntUntilSmartcastInt() {
var sum = 0
val a: Any = 5
if (a is Int) {
for (i: Int in 1 until a) {
sum = sum * 10 + i
}
}
assertEquals(1234, sum)
}