mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
18 lines
262 B
Kotlin
18 lines
262 B
Kotlin
class Delegate {
|
|
fun get(t: F.A, p: PropertyMetadata): Int = 1
|
|
}
|
|
|
|
class F {
|
|
val A.prop: Int by Delegate()
|
|
|
|
class A {
|
|
}
|
|
|
|
fun foo(): Int {
|
|
return A().prop
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return if(F().foo() == 1) "OK" else "fail"
|
|
} |