From 5f913b5595d9551faef9961f1def3fc1e73f4185 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Wed, 3 Aug 2022 20:21:01 +0200 Subject: [PATCH] [JS IR] Remove unused CALLABLE_CLOSURE_DECLARATION declaration origin --- .../jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt | 2 -- .../irToJs/IrElementToJsStatementTransformer.kt | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt index 27371156818..dae1fac0c3b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -147,8 +147,6 @@ class JsIrBackendContext( // TODO: due to name clash those weird suffix is required, remove it once `MemberNameGenerator` is implemented private val COROUTINE_SUSPEND_OR_RETURN_JS_NAME = "suspendCoroutineUninterceptedOrReturnJS" private val GET_COROUTINE_CONTEXT_NAME = "getCoroutineContext" - - val callableClosureOrigin = object : IrDeclarationOriginImpl("CALLABLE_CLOSURE_DECLARATION") {} } private val internalPackage = module.getPackage(JS_PACKAGE_FQNAME) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt index 4fc0a9c513f..008b1db2e75 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt @@ -27,10 +27,8 @@ import org.jetbrains.kotlin.js.backend.ast.* @Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE") class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer { - override fun visitFunction(declaration: IrFunction, data: JsGenerationContext) = JsEmpty.also { - assert(declaration.origin == JsIrBackendContext.callableClosureOrigin) { - "The only possible Function Declaration is one composed in Callable Reference Lowering" - } + override fun visitFunction(declaration: IrFunction, data: JsGenerationContext): JsStatement { + error("All functions must be already lowered") } override fun visitBlockBody(body: IrBlockBody, context: JsGenerationContext): JsStatement {