From 6876ccd3ee594af8d453e483175f68b5f7ba8536 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 10 Aug 2018 15:11:03 +0300 Subject: [PATCH] Fix handling implicit cast between different inline classes --- .../org/jetbrains/kotlin/backend/konan/lower/Autoboxing.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 4fe128b362a..6904f64e5ee 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 @@ -72,8 +72,6 @@ private class AutoboxingTransformer(val context: Context) : AbstractValueUsageTr return if (operator == IrTypeOperator.IMPLICIT_COERCION_TO_UNIT || operator == IrTypeOperator.IMPLICIT_INTEGER_COERCION) { this - } else if (operator == IrTypeOperator.IMPLICIT_CAST) { - this.useAs(typeOperand) } else { // Codegen expects the argument of type-checking operator to be an object reference: this.useAs(context.irBuiltIns.anyNType) @@ -124,7 +122,7 @@ private class AutoboxingTransformer(val context: Context) : AbstractValueUsageTr // TODO: is it a workaround for inconsistent IR? this.typeOperand - IrTypeOperator.CAST -> context.irBuiltIns.anyNType + IrTypeOperator.CAST, IrTypeOperator.IMPLICIT_CAST -> context.irBuiltIns.anyNType else -> this.type }