Files
kotlin-fork/compiler/testData/codegen/boxWithJava/sam/adapters/inheritedOverriddenAdapterInKotlin.kt
T
2013-07-02 14:06:09 +04:00

22 lines
401 B
Kotlin

class Sub() : Super() {
override fun foo(r : (() -> Unit)?) {
lastCalled = "sub"
}
}
fun box(): String {
val sub = Sub()
(sub : Super).foo{ }
if (sub.lastCalled != "super") {
return "FAIL: ${sub.lastCalled} instead of super"
}
sub.foo{ }
if (sub.lastCalled != "sub") {
return "FAIL: ${sub.lastCalled} instead of sub"
}
return "OK"
}