JVM_IR: Don't mangle internal constructor-impl for inline classes

This commit is contained in:
Dmitry Petrov
2020-07-02 12:57:18 +03:00
parent 5cfac8fa3f
commit dc4b9d3887
@@ -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)