mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
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.
14 lines
253 B
Kotlin
Vendored
14 lines
253 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
fun foo(): List<String>? = listOf("abcde")
|
|
|
|
fun box(): String {
|
|
for (i in 1..3) {
|
|
for (value in foo() ?: continue) {
|
|
if (value != "abcde") return "Fail"
|
|
}
|
|
}
|
|
return "OK"
|
|
}
|