[JS IR BE] Support Long coercion
This commit is contained in:
+3
-1
@@ -317,7 +317,9 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : FileLoweringPass {
|
||||
val casted = when {
|
||||
toType.isByte() -> maskOp(argument, byteMask, lit24)
|
||||
toType.isShort() -> maskOp(argument, shortMask, lit16)
|
||||
toType.isLong() -> TODO("Long coercion")
|
||||
toType.isLong() -> JsIrBuilder.buildCall(context.intrinsics.jsToLong).apply {
|
||||
putValueArgument(0, argument)
|
||||
}
|
||||
else -> error("Unreachable execution (coercion to non-Integer type")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val a1: Byte = 1.plus(1)
|
||||
val a2: Short = 1.plus(1)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val a1: Byte? = 1.plus(1)
|
||||
val a2: Short? = 1.plus(1)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val a1: Byte = 1 + 1
|
||||
val a2: Short = 1 + 1
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
val a1: Byte? = 1 + 1
|
||||
val a2: Short? = 1 + 1
|
||||
|
||||
Reference in New Issue
Block a user