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.
21 lines
392 B
Kotlin
Vendored
21 lines
392 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
// CHECK_CASES_COUNT: function=foo count=3
|
|
// CHECK_IF_COUNT: function=foo count=0
|
|
|
|
fun foo(x: Int): Int {
|
|
return when (x) {
|
|
2 -> 6
|
|
1 -> 5
|
|
3 -> 7
|
|
else -> 8
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
var result = (0..3).map(::foo).joinToString()
|
|
|
|
if (result != "8, 5, 6, 7") return "unordered:" + result
|
|
return "OK"
|
|
}
|