mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
21 lines
282 B
Kotlin
21 lines
282 B
Kotlin
trait A<T> {
|
|
val property : T
|
|
|
|
open fun a() : T {
|
|
return property
|
|
}
|
|
}
|
|
|
|
open class B : A<Any> {
|
|
|
|
override val property: Any = "fail"
|
|
}
|
|
|
|
open class C : B(), A<Any> {
|
|
|
|
override val property: Any = "OK"
|
|
}
|
|
|
|
fun box() : String {
|
|
return C().a() as String
|
|
} |