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.
25 lines
526 B
Kotlin
Vendored
25 lines
526 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
// CHECK_CASES_COUNT: function=foo count=4
|
|
// CHECK_IF_COUNT: function=foo count=0
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
fun foo(x : String) : String {
|
|
return when (x) {
|
|
"abc", "cde" -> "abc_cde"
|
|
"efg", "ghi" -> "efg_ghi"
|
|
else -> "other"
|
|
}
|
|
}
|
|
|
|
fun box() : String {
|
|
assertEquals("abc_cde", foo("abc"))
|
|
assertEquals("abc_cde", foo("cde"))
|
|
assertEquals("efg_ghi", foo("efg"))
|
|
assertEquals("efg_ghi", foo("ghi"))
|
|
|
|
assertEquals("other", foo("xyz"))
|
|
|
|
return "OK"
|
|
}
|