JVM IR: sanitize indy lambda proxy names correctly
In case there are several proxy functions for indy lambdas in the same container, its names are "...__proxy", "...__proxy-0", "...__proxy-1", ..., yet before this change, only the first one was sanitized. So if it's happening inside a constructor, `<init>` was left unrenamed which led to ClassFormatError. #KT-52040 Fixed
This commit is contained in:
@@ -116,10 +116,7 @@ internal val localDeclarationsPhase = makeIrFilePhase(
|
||||
{ context ->
|
||||
LocalDeclarationsLowering(
|
||||
context,
|
||||
object : LocalNameProvider {
|
||||
override fun localName(declaration: IrDeclarationWithName): String =
|
||||
NameUtils.sanitizeAsJavaIdentifier(super.localName(declaration))
|
||||
},
|
||||
NameUtils::sanitizeAsJavaIdentifier,
|
||||
object : VisibilityPolicy {
|
||||
// Note: any condition that results in non-`LOCAL` visibility here should be duplicated in `JvmLocalClassPopupLowering`,
|
||||
// else it won't detect the class as local.
|
||||
|
||||
Reference in New Issue
Block a user