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
478 B
Kotlin
Vendored
25 lines
478 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
interface A {
|
|
fun foo(): Collection<String>
|
|
}
|
|
|
|
interface B : A {
|
|
override fun foo(): MutableCollection<String>
|
|
}
|
|
|
|
class C : B {
|
|
override fun foo(): MutableList<String> = ArrayList(listOf("C"))
|
|
}
|
|
|
|
fun box(): String {
|
|
val c = C()
|
|
var r = c.foo().iterator().next()
|
|
val b: B = c
|
|
val a: A = c
|
|
r += b.foo().iterator().next()
|
|
r += a.foo().iterator().next()
|
|
return if (r == "CCC") "OK" else "Fail: $r"
|
|
}
|