Files
kotlin-fork/compiler/testData/codegen/box/traits/withRequired/genericProperty.kt
T
2015-05-12 19:43:17 +02:00

20 lines
314 B
Kotlin
Vendored

abstract class Base<T> {
abstract var s: T
}
interface Trait<T> : Base<T> {
var value : T
get() = s
set(value) { s = value }
}
class Derived : Trait<String>, Base<String>() {
override var s = "Fail"
}
fun box(): String {
val d = Derived()
d.value = "OK"
return d.value
}