9dd8eda1c9
Library methods such as 'listOf' are resolved to have the package fragments as their parents, but JVM expects their containing file classes as parents. This fix generates those file classes and uses them as parent replacements for such library methods.
19 lines
321 B
Kotlin
Vendored
19 lines
321 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
package regressions
|
|
|
|
fun f(xs: Iterator<Int>): Int {
|
|
var answer = 0
|
|
for (x in xs) {
|
|
answer += x
|
|
}
|
|
return answer
|
|
}
|
|
|
|
fun box(): String {
|
|
val list = arrayListOf(1, 2, 3)
|
|
val result = f(list.iterator())
|
|
return if (6 == result) "OK" else "fail"
|
|
}
|