Delegated Properties: Code generation for local properties (JVM)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int = 3
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
val prop: Int by Delegate()
|
||||
return prop
|
||||
}
|
||||
|
||||
val x = foo()
|
||||
|
||||
// expected: x: 3
|
||||
Reference in New Issue
Block a user