Files
kotlin/compiler/testData/codegen/box/ranges/forInUntil/forIntInIntUntilSmartcastInt.kt
Roman Artemev cc14442be1 Add tests for primitive companion object
Update test data
2018-08-24 14:58:42 +03:00

21 lines
340 B
Kotlin
Vendored

// 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)
}