[JS IR BE] Use Char boxing rules of current backend
This commit is contained in:
+8
-3
@@ -13,9 +13,7 @@ import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder
|
||||
import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.isNothing
|
||||
import org.jetbrains.kotlin.ir.types.makeNotNull
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
|
||||
|
||||
@@ -73,6 +71,13 @@ class AutoboxingTransformer(val context: JsIrBackendContext) : AbstractValueUsag
|
||||
val actualInlinedClass = actualType.getInlinedClass()
|
||||
val expectedInlinedClass = expectedType.getInlinedClass()
|
||||
|
||||
// Mimicking behaviour of current JS backend
|
||||
// TODO: Revisit
|
||||
if (
|
||||
(actualType is IrDynamicType && expectedType.makeNotNull().isChar()) ||
|
||||
(actualType.makeNotNull().isChar() && expectedType is IrDynamicType)
|
||||
) return this
|
||||
|
||||
val function = when {
|
||||
actualInlinedClass == null && expectedInlinedClass == null -> return this
|
||||
actualInlinedClass != null && expectedInlinedClass == null -> context.intrinsics.jsBoxIntrinsic
|
||||
|
||||
Reference in New Issue
Block a user