Files
kotlin-fork/compiler/testData/codegen/box/ranges/unsigned/nullableLoopParameter/rangeLiteral.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

17 lines
405 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// See KT-38833: Runtime exception is "java.lang.ClassCastException: java.lang.Integer cannot be cast to kotlin.UInt"
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
fun box(): String {
var result = 0u
for (i: UInt? in 1u..3u) {
result = sum(result, i)
}
return if (result == 6u) "OK" else "fail: $result"
}
fun sum(i: UInt, z: UInt?): UInt {
return i + z!!
}