diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt index c8380e3c6f2..c677df424f9 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt @@ -111,11 +111,18 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { return newName } - return if (function !is IrConstructor && function.visibility == Visibilities.INTERNAL && !function.isPublishedApi()) { + return if (function.shouldMangleAsInternal()) KotlinTypeMapper.InternalNameMapper.mangleInternalName(newName, getModuleName(function)) - } else newName + else + newName } + private fun IrFunction.shouldMangleAsInternal() = + this !is IrConstructor && + origin != JvmLoweredDeclarationOrigin.STATIC_INLINE_CLASS_CONSTRUCTOR && + visibility == Visibilities.INTERNAL && + !isPublishedApi() + private fun getModuleName(function: IrFunction): String = (if (function is IrLazyFunctionBase) getJvmModuleNameForDeserialized(function)