Kotlin: make internal constructors' trap labels consistent with the Java extractor

Previously we accidentally named these something like <init>$main, which is a name-mangling the Kotlin compiler applies to internal methods but not to constructors, which look to Java just like regular public constructors.
This commit is contained in:
Chris Smowton
2022-10-21 16:47:14 +01:00
parent 88c6453fa6
commit 00800017fd
5 changed files with 16 additions and 1 deletions

View File

@@ -813,7 +813,7 @@ open class KotlinUsesExtractor(
OperatorNameConventions.INVOKE.asString())
fun getSuffixIfInternal() =
if (f.visibility == DescriptorVisibilities.INTERNAL) {
if (f.visibility == DescriptorVisibilities.INTERNAL && f !is IrConstructor) {
"\$" + getJvmModuleName(f)
} else {
""