FIR2IR: Rework resulted overridden-relation structure

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.
This commit is contained in:
Denis.Zharkov
2021-02-18 09:53:54 +03:00
parent fd146e3eed
commit a750d9466e
24 changed files with 389 additions and 69 deletions
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
abstract class AbstractAdd {
abstract fun add(s: String): Any
}
@@ -23,4 +21,4 @@ fun test2(a: AbstractStringCollection) =
a.add("K") as String
fun box() =
test1(StringCollection()) + test2(StringCollection())
test1(StringCollection()) + test2(StringCollection())
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// FILE: javaCollectionWithRemovePrimitiveInt.kt