Allow top-level local delegated properties in scripts

This commit is contained in:
Mikhael Bogdanov
2016-05-10 10:36:44 +03:00
parent 6ece2b41d6
commit c06b51c1d1
10 changed files with 60 additions and 14 deletions
@@ -0,0 +1,23 @@
>>> import kotlin.reflect.KProperty;
>>> class Delegate {
... var inner = 1
... operator fun getValue(t: Any?, p: KProperty<*>): Int = inner
... operator fun setValue(t: Any?, p: KProperty<*>, i: Int) {
... inner = i
... }
...}
>>> var prop1: Int = 1
>>> prop1
1
>>> prop1 = 2
>>> prop1
2
>>> var prop2: Int = 100
>>> prop2
100
>>> prop2 = prop2 + 2
>>> prop2
102
>>> prop1
2