Support custom accessors for top-level properties in scripts.

This commit is contained in:
Dmitry Petrov
2017-01-24 10:29:34 +03:00
parent ab2448307e
commit a974ed1049
25 changed files with 750 additions and 47 deletions
@@ -0,0 +1,25 @@
var log = "begin"
fun append(msg: String) {
log = "$log;$msg"
}
val test1 get() = run {
append("test1.get")
"1"
}
val test2 get() = run {
append("test2.get")
test1
}
var test3: String = "Z"
set(value) {
append("test3.set")
field = value
}
test3 = "3"
val r = "$test1;$test2;$test3|$log"
// expected: r: 1;1;3|begin;test3.set;test1.get;test2.get;test1.get