Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/pdAsExtensionFun.kt
T
2014-09-24 15:34:12 +04:00

15 lines
280 B
Kotlin

class Delegate {
var name = ""
fun get(t: Any?, p: PropertyMetadata): String = name
}
fun Delegate.propertyDelegated(p: PropertyMetadata) { name = p.name }
class A {
val prop by Delegate()
}
fun box(): String {
return if (A().prop == "prop") "OK" else "fail"
}