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.
29 lines
522 B
Kotlin
Vendored
29 lines
522 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"
|
|
}
|
|
|
|
return "other"
|
|
}
|
|
|
|
fun box() : String {
|
|
assertEquals("abz", foo("abz]"))
|
|
assertEquals("aby", foo("aby|"))
|
|
assertEquals("ghi", foo("ghi"))
|
|
|
|
assertEquals("other", foo("xyz"))
|
|
|
|
return "OK"
|
|
}
|