Files
kotlin-fork/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt
T
2014-11-17 17:45:05 +03:00

19 lines
408 B
Kotlin

class Holder(var value: Int) {
fun get(that: Any?, desc: PropertyMetadata) = value
fun set(that: Any?, desc: PropertyMetadata, newValue: Int) { value = newValue }
}
trait R<T: Comparable<T>> {
var value: T
}
class A(start: Int) : R<Int> {
override var value: Int by Holder(start)
}
fun box(): String {
val a = A(239)
a.value = 42
return if (a.value == 42) "OK" else "Fail 1"
}