Disambiguate the names and trap labels of backing fields of extension properties

This commit is contained in:
Chris Smowton
2022-05-27 16:26:51 +01:00
parent 6eb2935469
commit 9ea139566d
5 changed files with 36 additions and 2 deletions

View File

@@ -759,7 +759,8 @@ open class KotlinFileExtractor(
with("field", f) {
DeclarationStackAdjuster(f).use {
declarationStack.push(f)
return extractField(useField(f), f.name.asString(), f.type, parentId, tw.getLocation(f), f.visibility, f, isExternalDeclaration(f), f.isFinal)
val fNameSuffix = getExtensionReceiverType(f)?.let { it.classFqName?.asString()?.replace(".", "$$") } ?: ""
return extractField(useField(f), "${f.name.asString()}$fNameSuffix", f.type, parentId, tw.getLocation(f), f.visibility, f, isExternalDeclaration(f), f.isFinal)
}
}
}