Files
kotlin-fork/compiler/testData/codegen/box/traits/withRequired/genericProperty.kt
T
Alexander Udalov fc838dbb53 Refactor ImplementationBodyCodegen.getTraitImplementations()
Make it static, extract a method which finds an implementation in a trait for a
fake override
2014-04-11 21:57:46 +04:00

20 lines
310 B
Kotlin

abstract class Base<T> {
abstract var s: T
}
trait 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
}