K2: repeat K1 behavior around multiple inheritance by delegation

#KT-56720 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-03-03 10:13:11 +01:00
committed by Space Team
parent ab883d91c8
commit 45e78455b2
10 changed files with 127 additions and 22 deletions
@@ -0,0 +1,30 @@
// TARGET_BACKEND: JVM_IR
// JVM_TARGET: 1.8
// FILE: A.java
public interface A {
default String foo() {
return "OK";
}
}
// FILE: B.java
public interface B extends A {}
// FILE: C.java
public interface C extends A {}
// FILE: test.kt
class Adapter : B, C
class D(val b: B, val c: C) : B by b, C by c
fun box(): String {
val b = Adapter()
val c = Adapter()
val d = D(b, c)
return d.foo()
}