[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
+21
@@ -0,0 +1,21 @@
|
||||
C:
|
||||
[Java]: public open field x: R|kotlin/Int| from Java enhancement scope for /C [id: 0]
|
||||
[Java]: private open field y: R|kotlin/Int| from Java enhancement scope for /C [id: 0]
|
||||
|
||||
D:
|
||||
[Java]: public open field x: R|kotlin/Int| from Java enhancement scope for /D [id: 0]
|
||||
[IntersectionOverride]: public abstract val x: R|kotlin/Int| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public abstract val x: R|kotlin/Int| from Use site scope of /A [id: 1]
|
||||
[Source]: public abstract val x: R|kotlin/String| from Use site scope of /B [id: 2]
|
||||
[Java]: private open field y: R|kotlin/Int| from Java enhancement scope for /D [id: 0]
|
||||
[Synthetic]: public abstract val y: R|kotlin/Int| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public abstract val y: R|kotlin/Int| from Use site scope of /A [id: 1]
|
||||
[Source]: public abstract val y: R|kotlin/Int| from Use site scope of /B [id: 2]
|
||||
[Enhancement]: public abstract fun getX(): R|ft<kotlin/Any, kotlin/Any?>| from Java enhancement scope for /D [id: 0]
|
||||
|
||||
E:
|
||||
[IntersectionOverride]: public abstract val x: R|kotlin/Int| from Java enhancement scope for /E [id: 0]
|
||||
[Source]: public abstract val x: R|kotlin/Int| from Use site scope of /A [id: 1]
|
||||
[Source]: public abstract val x: R|kotlin/String| from Use site scope of /B [id: 2]
|
||||
[Enhancement]: public abstract fun getX(): R|ft<kotlin/Any, kotlin/Any?>| from Java enhancement scope for /E [id: 0]
|
||||
|
||||
Reference in New Issue
Block a user