Files
kotlin-fork/js/js.translator/testData/box/coercion/defaultAccessors.kt
T
Roman Artemev 987c6ab3ee [JS IR] Roll making Char inline class back
- un/mute falling tests
2019-11-25 20:22:03 +03:00

33 lines
617 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1288
// IGNORE_BACKEND: JS_IR
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
}
}
val expectedCharRepresentationInProperty = if (testUtils.isLegacyBackend()) "object" else "number"
fun box(): String {
val t = jsTypeOf(X.asDynamic().a)
if (t != expectedCharRepresentationInProperty) return "fail1: $t"
Y.a = '@'
Y.a
if (result != "number") return "fail2: $result"
return "OK"
}