From ab6f57796451cb39976ea5b8eb2717c0f988b8aa Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Fri, 21 May 2021 13:43:03 +0300 Subject: [PATCH] [Native] Support suspend functions as supertypes (remove debug code) ^KT-46777 --- .../common/lower/AbstractSuspendFunctionsLowering.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt index 72cc614a491..828aa75e5b4 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt @@ -150,8 +150,7 @@ abstract class AbstractSuspendFunctionsLowering(val co expression.acceptChildrenVoid(this) if (expression.isSuspend) { - val old = suspendLambdas.put(expression.symbol.owner, expression) - if (old != null) error("Rewriting $old") + suspendLambdas[expression.symbol.owner] = expression } } }) @@ -283,8 +282,7 @@ abstract class AbstractSuspendFunctionsLowering(val co private fun buildCoroutine(irFunction: IrSimpleFunction, functionReference: IrFunctionReference?): IrClass { val coroutine = CoroutineBuilder(irFunction, functionReference).build() - val old = builtCoroutines.put(irFunction, coroutine) - if (old != null) error("Rewriting $old") + builtCoroutines[irFunction] = coroutine if (functionReference == null) { // It is not a lambda - replace original function with a call to constructor of the built coroutine.