Trying to use spread from JS on a Kotlin JS (IR) c...
# javascript
r
Trying to use spread from JS on a Kotlin JS (IR) class object, but it’ll use the mangled fields. Are there any issues/design notes on this?
Copy code
@JsExport
data class Shape(val type: String, val sides: Int)
Copy code
const a = new Shape("square", 4)
const obj = {...a}
Expected:
{ type: "square", sides: 4 }
Actual:
{ _type_1: "square", _sides: 4 }
t
r
@turansky Thanks. That name is somewhat cryptic, so no wonder I couldn’t find it before. Thanks for the pointer!