Files
kotlin/compiler/testData/codegen/box/controlStructures/forInSmartCastToArray.kt
Denis Zharkov 654411a0b0 Refactored tests using Array constructor:
Some moved to tests with stdlib
Some changed to use arrayOfNulls
2014-12-11 16:04:03 +03:00

15 lines
243 B
Kotlin
Vendored

fun f(x: Any?): String {
if (x is Array<String>) {
for (i in x) {
return i
}
}
return "FAIL"
}
fun box(): String {
val a = arrayOfNulls<String>(1) as Array<String>
a[0] = "OK"
return f(a)
}