Files
kotlin-fork/translator/testFiles/examples/cases/inheritedMethod.jet
T
2011-11-28 17:40:39 +04:00

14 lines
211 B
Plaintext

open class Foo {
fun xyzzy(): String = "xyzzy"
}
class Bar(): Foo {
fun test(): String = xyzzy()
}
fun box() : String {
val bar = Bar()
val f = bar.test()
return if (f == "xyzzy") "OK" else "fail"
}