mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 00:21:28 +00:00
21 lines
340 B
Kotlin
Vendored
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)
|
|
} |