Delegated Properties: Code generation for local properties (JVM)

This commit is contained in:
Dotlin
2015-09-30 02:33:45 +03:00
committed by Mikhael Bogdanov
parent fa523b9af4
commit 4c223845b6
22 changed files with 563 additions and 78 deletions
@@ -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