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,15 @@
|
||||
trait A {
|
||||
fun foo(): Any = "A"
|
||||
}
|
||||
|
||||
trait B : A {
|
||||
override fun foo(): String = "B"
|
||||
}
|
||||
|
||||
class C : B
|
||||
|
||||
fun box(): String {
|
||||
val c = C()
|
||||
var r = c.foo() + (c : B).foo() + (c : A).foo()
|
||||
return if (r == "BBB") "OK" else "Fail: $r"
|
||||
}
|
||||
Reference in New Issue
Block a user