[Wasm] Fix transforming setField in an inline class constructor body
IrSetField was transformed to its value to preserve side effects This transformation produced invalid IR in cases where IrSetField used in Unit-returning expression context. This commit fixes it by producing Unit-typed expression ^KT-59084 Fixed
This commit is contained in:
committed by
Space Team
parent
6fba6a2e3c
commit
833c8b2cd4
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: WASM
|
||||
|
||||
inline class JsDynamic(val value: JsAny?)
|
||||
|
||||
val JsAny?.jsDyn: JsDynamic get() = JsDynamic(this)
|
||||
|
||||
fun test(): Boolean {
|
||||
val jsDynamic: JsAny? = 1.toJsNumber()
|
||||
val jsDyn = jsDynamic.jsDyn
|
||||
return jsDyn.value == jsDynamic
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (!test()) {
|
||||
return "Fail"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user