[JS IR BE] Support Long coercion

This commit is contained in:
Svyatoslav Kuzmich
2018-10-02 19:02:39 +03:00
parent c7bde6a5e6
commit 749556f565
5 changed files with 3 additions and 5 deletions
@@ -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")
}