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

15 lines
288 B
Kotlin

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