JS: add boxing/unboxing to default accessors of non-simple properties

See KT-21421
This commit is contained in:
Alexey Andreev
2017-11-23 19:36:19 +03:00
parent be4e2f96c2
commit 7bee2ceac7
3 changed files with 46 additions and 3 deletions
@@ -0,0 +1,29 @@
// EXPECTED_REACHABLE_NODES: 1140
interface I {
val a: Char
}
object X : I {
override var a = '#'
}
var result = ""
object Y : I {
override var a = '#'
get() {
result = jsTypeOf(field.asDynamic())
return field
}
}
fun box(): String {
val t = jsTypeOf(X.asDynamic().a)
if (t != "object") return "fail1: $t"
Y.a = '@'
Y.a
if (result != "number") return "fail2: $result"
return "OK"
}