Preserve visibility of classes copied by inliner
This commit is contained in:
committed by
SvyatoslavScherbina
parent
7889d13974
commit
6114a5b35c
+7
-2
@@ -356,7 +356,10 @@ class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescriptor,
|
||||
oldDescriptor.name // We need to preserve it for LocalDeclarationsLowering.
|
||||
else
|
||||
generateCopyName(oldDescriptor.name)
|
||||
return ClassDescriptorImpl(
|
||||
|
||||
val visibility = oldDescriptor.visibility
|
||||
|
||||
return object : ClassDescriptorImpl(
|
||||
/* containingDeclaration = */ newContainingDeclaration,
|
||||
/* name = */ newName,
|
||||
/* modality = */ oldDescriptor.modality,
|
||||
@@ -364,7 +367,9 @@ class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescriptor,
|
||||
/* supertypes = */ listOf(newSuperClass.defaultType) + newInterfaces.map { it.defaultType },
|
||||
/* source = */ oldDescriptor.source,
|
||||
/* isExternal = */ oldDescriptor.isExternal
|
||||
)
|
||||
) {
|
||||
override fun getVisibility() = visibility
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user