Generate bridges for trait implementations properly
The intent was to keep the bridge codegen model as simple as possible: we should be able to figure out all necessary bridges only by a minimal interface that FunctionHandle provides (isAbstract, isDeclaration, getOverridden) Add different tests for bridges #KT-318 Obsolete
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
abstract class A {
|
||||
abstract fun foo(): Any
|
||||
}
|
||||
|
||||
trait B {
|
||||
fun foo(): String = "B"
|
||||
}
|
||||
|
||||
trait C : A, B
|
||||
|
||||
class D : A(), C
|
||||
|
||||
fun box(): String {
|
||||
val d = D()
|
||||
val r = d.foo() + (d : C).foo() + (d : B).foo() + (d : A).foo()
|
||||
return if (r == "BBBB") "OK" else "Fail: $r"
|
||||
}
|
||||
Reference in New Issue
Block a user