[FIR] Replace single supertype scope with list of scopes of supertypes in use site scopes
This big refactoring is needed to cleanup building of overrides
mappings and prevent creating redundant intersection overrides in
cases when there is no need in them:
```kotlin
interface A {
fun foo()
}
interface B {
fun foo()
}
interface C : A, B {
override fun foo()
}
```
Before this refactoring there was next override tree:
C.foo
intersection override (A.foo, B.foo)
A.foo
B.foo
Also this commit fixes special mapping of overrides in jvm scopes
for declarations which have kotlin builtins in supertypes with
special java mapping rules (collections, for example)
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
// SCOPE_DUMP: D:x;getX;y;getY
|
||||
|
||||
// FILE: B.java
|
||||
public abstract class B extends A {
|
||||
@Override
|
||||
public int getX() { return 0; }
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
public interface C {
|
||||
int getX();
|
||||
int getY();
|
||||
}
|
||||
|
||||
// FILE: D.java
|
||||
public abstract class D extends B implements C {}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
abstract class A {
|
||||
open val x: Int
|
||||
get() = 1
|
||||
open val y: Int
|
||||
get() = 2
|
||||
}
|
||||
|
||||
class DImpl : D()
|
||||
|
||||
Reference in New Issue
Block a user