From e405799b3bb7d9cb37ad176ab3ec63ca324b7ae3 Mon Sep 17 00:00:00 2001 From: Artem Kobzar Date: Thu, 7 Apr 2022 20:53:48 +0200 Subject: [PATCH] chore: use fqName instead of custom crafted name. --- .../irToJs/IrElementToJsStatementTransformer.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 e31044e9dd6..9153c51316b 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 @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.backend.js.utils.JsGenerationContext import org.jetbrains.kotlin.ir.backend.js.utils.emptyScope import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.declarations.IrVariable import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol @@ -20,6 +21,7 @@ import org.jetbrains.kotlin.ir.types.classOrNull import org.jetbrains.kotlin.ir.types.isAny import org.jetbrains.kotlin.ir.util.constructedClassType import org.jetbrains.kotlin.ir.util.file +import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.js.backend.ast.* @@ -59,10 +61,9 @@ class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer.wrapInCommentsInlineFunctionCall(expression: IrReturnableBlock): List { val inlineFunctionSymbol = expression.inlineFunctionSymbol ?: return this - val owner = inlineFunctionSymbol.owner - val receiver = (owner.dispatchReceiverParameter ?: owner.extensionReceiverParameter)?.type?.classOrNull?.owner - val receiverName = receiver?.name?.asString()?.plus(".") ?: "" - val funName = "$receiverName${owner.name}" + val correspondingProperty = (inlineFunctionSymbol.owner as? IrSimpleFunction)?.correspondingPropertySymbol + val owner = correspondingProperty?.owner ?: inlineFunctionSymbol.owner + val funName = owner.fqNameWhenAvailable ?: owner.name return listOf(JsSingleLineComment(" Inline function '$funName' call")) + this }