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