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)
27 lines
418 B
Kotlin
Vendored
27 lines
418 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// SKIP_KT_DUMP
|
|
// DUMP_EXTERNAL_CLASS: X
|
|
// DUMP_EXTERNAL_CLASS: AX
|
|
// FILE: kt45853.kt
|
|
|
|
abstract class A {
|
|
abstract val a: A?
|
|
}
|
|
|
|
class B() : AX() {
|
|
override fun getA(): X? = super.a
|
|
}
|
|
|
|
// FILE: X.java
|
|
public interface X {
|
|
X getA();
|
|
}
|
|
|
|
// FILE: AX.java
|
|
public abstract class AX extends A implements X {
|
|
@Override
|
|
public AX getA() {
|
|
return (AX) super.getA();
|
|
}
|
|
}
|