Files
kotlin-fork/backend.native/tests/codegen/bridges/test9.kt
T
Igor Chevdar c746da3ce4 Bridges (#240)
* - bridges building
- bridges support in vtable and methods table

* FunctionDescriptor.signature fix + some assertions

* tests

* refactoring

* refactoring

* removed debug output

* refactoring

* review fixes

* implemented bridge construction for parameters

* tests

* refactoring

* removed custom box/unbox

* added bridge for extension receiver
2017-02-16 15:26:57 +05:00

27 lines
434 B
Kotlin

// abstract class vtable call
abstract class A {
abstract fun foo(): String
}
abstract class B : A()
class Z : B() {
override fun foo() = "Z"
}
fun box(): String {
val z = Z()
val b: B = z
val a: A = z
return when {
z.foo() != "Z" -> "Fail #1"
b.foo() != "Z" -> "Fail #2"
a.foo() != "Z" -> "Fail #3"
else -> "OK"
}
}
fun main(args: Array<String>) {
println(box())
}