JS: apply boxing when initializing val parameter of type Char

See KT-20854
This commit is contained in:
Alexey Andreev
2017-10-20 13:44:52 +03:00
parent 32a0221474
commit 7ebfba3722
3 changed files with 29 additions and 2 deletions
@@ -0,0 +1,16 @@
// EXPECTED_REACHABLE_NODES: 1127
class A(val x: Char)
fun typeOf(x: dynamic): String = js("typeof x")
fun box(): String {
val a = A('0')
var r = typeOf(a.asDynamic().x)
if (r != "object") return "fail1: $r"
r = typeOf(a.x)
if (r != "number") return "fail2: $r"
return "OK"
}