a750d9466e
The difference is how we deal with intermediate fake overrides
E.g., in case
interface A { /* $1 */ fun foo() }
interface B : A {
/* $2 */ fake_override fun foo()
}
interface C : B {
/* $3 */ override fun foo()
}
We've got FIR declarations only for $1 and $3, but we've got
a fake override for $2 in IR.
Previously, override $3 had $1 as its overridden IR symbol, just because
FIR declaration of $3 doesn't know anything about $2.
Now, when generating IR for $2, we save the necessary information
and using it for $3, so it has $2 as overridden.
So, it's consistent with the overridden structure of FE 1.0 and this
structure is necessary prerequisite for proper building of bridges
for special built-ins.
17 lines
489 B
Kotlin
Vendored
17 lines
489 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
import java.util.AbstractMap
|
|
|
|
// Neither of getSize, getKeys, getEntries, getValues generated here should be final.
|
|
abstract class AbstractMutableMap<K, V> : MutableMap<K, V>, AbstractMap<K, V>()
|
|
|
|
class MyMap<K, V> : AbstractMutableMap<K, V>() {
|
|
override val size: Int
|
|
get() = 1
|
|
override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
|
|
get() = null!!
|
|
}
|
|
|
|
fun box(): String =
|
|
if (MyMap<String, String>().size == 1) "OK" else "Fail"
|