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

18 lines
336 B
Kotlin

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