alignModuleName

private fun alignModuleName(current: String?, fns: List<KmFunction>, props: List<KmProperty>, set: (String) -> Unit): Boolean

Realign moduleName with the $suffix this declaration's own internal members actually carry.

A call to an internal member is mangled name$sanitize(moduleName), and the compiler reads moduleName from the metadata proto — so a jar whose moduleName was rewritten while its member names were not links against a method that does not exist, and it fails at the call site rather than at compile time. The JvmMethodSignature names what the bytecode declares, which makes it the reference. Aligned jars stop at the comparison; as of 2.4.21 only kotlin-metadata-jvm needs the rewrite — its shadow relocation (org.jetbrains.kotlin → kotlin.metadata.internal) reaches the moduleName string but not the sanitized $org_jetbrains_kotlin_… suffix.