Update compiler tests to use KProperty instead of PropertyMetadata
This commit is contained in:
+4
-2
@@ -1,14 +1,16 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
public open class TestDelegate<T: Any>(private val initializer: () -> T) {
|
||||
private var value: T? = null
|
||||
|
||||
public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
public open fun getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
if (value == null) {
|
||||
value = initializer()
|
||||
}
|
||||
return value!!
|
||||
}
|
||||
|
||||
public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) {
|
||||
public open fun setValue(thisRef: Any?, desc: KProperty<*>, svalue : T) {
|
||||
value = svalue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user