Files
codeql/java/ql/test/kotlin/library-tests/for-array-iterators/test.kt
Chris Smowton 1cbe26a54f Kotlin: fix for-loop iterators over primitive or wildcard types
Array<*> can't be queried for an argument type, and IntArray doesn't have an argument at all; both were previously causing the extractor to fail to extract the whole file due to throwing an exception.
2022-07-21 09:13:55 +01:00

12 lines
181 B
Kotlin

fun test(x: Array<String>, y: Array<*>, z: IntArray): Int {
var ret = 0
for (el in x) { ret += 1 }
for (el in y) { ret += 1 }
for (el in z) { ret += 1 }
return ret
}