Files
kotlin/compiler/testData/codegen/controlStructures/forInSmartCastedToArray.kt
Evgeny Gerashchenko c33b880a57 EA-39177 - CCE: ArrayIterator.generate
If local variable is auto-casted to array, it should be iterated as array.
2012-09-14 16:12:16 +04:00

11 lines
184 B
Kotlin

fun f(x: Any?): String {
if (x is Array<String>) {
for (i in x) {
return i
}
}
return "FAIL"
}
fun box(): String = f(Array<String>(1, {"OK"}))