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

21 lines
352 B
Kotlin
Vendored

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