c80cfb0fdb
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)
43 lines
659 B
Kotlin
Vendored
43 lines
659 B
Kotlin
Vendored
// SCOPE_DUMP: C:foo;x;y;getX, D:x;y;getX, E:x;getX
|
|
|
|
// FILE: lib.kt
|
|
interface A {
|
|
fun foo(): Any
|
|
val x: Int
|
|
val y: Int
|
|
}
|
|
|
|
interface B {
|
|
fun foo(): Any
|
|
val x: String
|
|
val y: Int
|
|
}
|
|
|
|
// FILE: C.java
|
|
public abstract class C {
|
|
public int x;
|
|
private int y;
|
|
}
|
|
|
|
// FILE: D.java
|
|
public abstract class D extends C implements A, B {
|
|
public abstract Object foo();
|
|
|
|
public abstract Object getX();
|
|
public abstract int getY();
|
|
}
|
|
|
|
// FILE: E.java
|
|
public abstract class E implements A, B {
|
|
public abstract Object foo();
|
|
|
|
public abstract Object getX();
|
|
}
|
|
|
|
// FILE: main.kt
|
|
|
|
fun test(d: D) {
|
|
val a = d.x
|
|
val b = d.y
|
|
}
|