Files
kotlin/compiler/testData/codegen/box/defaultArguments/function/trait.kt
2014-01-23 17:59:18 +04:00

14 lines
290 B
Kotlin

trait Base {
fun bar(a: String = "abc"): String = a + " from trait"
}
class Derived: Base {
override fun bar(a: String): String = a + " from class"
}
fun box(): String {
val result = Derived().bar()
if (result != "abc from class") return "Fail: $result"
return "OK"
}