From ac757e1285d780c15999f72920f244ac966345a2 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 6 Mar 2017 11:44:21 +0700 Subject: [PATCH] backend: workaround boxing of IMPLICIT_INTEGER_COERCION result --- .../jetbrains/kotlin/backend/konan/lower/Autoboxing.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt index ddbc3148f1b..3ade142d048 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt @@ -112,6 +112,15 @@ private class AutoboxingTransformer(val context: Context) : AbstractValueUsageTr val actualType = when (this) { is IrCall -> this.descriptor.original.returnType ?: this.type is IrGetField -> this.descriptor.original.type + + is IrTypeOperatorCall -> when (this.operator) { + IrTypeOperator.IMPLICIT_INTEGER_COERCION -> + // TODO: is it a workaround for inconsistent IR? + this.typeOperand + + else -> this.type + } + else -> this.type }