Files
kotlin-fork/backend.native/tests/external/codegen/box/delegatedProperty/delegateForExtProperty.kt
T
2017-03-13 15:31:46 +03:00

15 lines
219 B
Kotlin

import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: A, p: KProperty<*>): Int = 1
}
val A.prop: Int by Delegate()
class A {
}
fun box(): String {
return if(A().prop == 1) "OK" else "fail"
}