[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:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// SCOPE_DUMP: C:foo;x, Explicit:foo;x, Implicit:foo;x
|
||||
|
||||
interface A {
|
||||
fun foo(): Any
|
||||
val x: Any
|
||||
}
|
||||
|
||||
interface B : A {
|
||||
override fun foo(): Any
|
||||
override val x: Any
|
||||
}
|
||||
|
||||
interface C : A, B
|
||||
|
||||
interface D {
|
||||
fun foo(): Int
|
||||
val x: Any
|
||||
}
|
||||
|
||||
interface Explicit : C, D {
|
||||
override fun foo(): Int
|
||||
override val x: Any
|
||||
}
|
||||
|
||||
interface Implicit : C, D
|
||||
Reference in New Issue
Block a user