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.
31 lines
588 B
Kotlin
Vendored
31 lines
588 B
Kotlin
Vendored
// IGNORE_BACKEND: NATIVE
|
|
|
|
// WITH_RUNTIME
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
fun foo(x : String) : String {
|
|
assertEquals("abz]".hashCode(), "aby|".hashCode())
|
|
|
|
when (x) {
|
|
"abz]" -> return "abz"
|
|
"ghi" -> return "ghi"
|
|
"aby|" -> return "aby"
|
|
"abz]" -> return "fail"
|
|
"uvw" -> return "uvw"
|
|
}
|
|
|
|
return "other"
|
|
}
|
|
|
|
fun box() : String {
|
|
assertEquals("abz", foo("abz]"))
|
|
assertEquals("aby", foo("aby|"))
|
|
assertEquals("ghi", foo("ghi"))
|
|
assertEquals("uvw", foo("uvw"))
|
|
|
|
assertEquals("other", foo("xyz"))
|
|
|
|
return "OK"
|
|
}
|