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.
18 lines
368 B
Kotlin
Vendored
18 lines
368 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
fun concatNonNulls(strings: List<String?>): String {
|
|
var result = ""
|
|
for (str in strings) {
|
|
result += str?:continue
|
|
}
|
|
return result
|
|
}
|
|
|
|
fun box(): String {
|
|
val test = concatNonNulls(listOf("abc", null, null, "", null, "def"))
|
|
if (test != "abcdef") return "Failed: test=$test"
|
|
|
|
return "OK"
|
|
}
|