19 lines
246 B
Kotlin
19 lines
246 B
Kotlin
trait A {
|
|
val prop: Int
|
|
}
|
|
|
|
class AImpl: A {
|
|
override val prop by Delegate()
|
|
}
|
|
|
|
fun foo() {
|
|
AImpl().prop
|
|
}
|
|
|
|
class Delegate {
|
|
fun get(t: Any?, p: String): Int {
|
|
t.equals(p) // to avoid UNUSED_PARAMETER warning
|
|
return 1
|
|
}
|
|
}
|