JVM_IR: remove a descriptor-related hack from InterfaceLowering
It will break with FIR.
This commit is contained in:
+3
-1
@@ -41,7 +41,9 @@ class DescriptorMetadataSerializer(
|
||||
if (localDelegatedProperties != null && localDelegatedProperties.isNotEmpty()) {
|
||||
context.state.bindingTrace.record(
|
||||
CodegenBinding.DELEGATED_PROPERTIES_WITH_METADATA,
|
||||
type,
|
||||
// When serializing metadata for interfaces, `JvmSerializerExtension.serializeClass`
|
||||
// looks at `$DefaultImpls` for some reason that's probably related to the old backend.
|
||||
if (irClass.isInterface) context.typeMapper.mapClass(context.cachedDeclarations.getDefaultImplsClass(irClass)) else type,
|
||||
localDelegatedProperties.mapNotNull { (it.owner.metadata as? DescriptorMetadataSource.LocalDelegatedProperty)?.descriptor }
|
||||
)
|
||||
}
|
||||
|
||||
-7
@@ -155,13 +155,6 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
||||
|
||||
val defaultImplsIrClass = context.cachedDeclarations.getDefaultImplsClass(irClass)
|
||||
|
||||
// Move metadata for local delegated properties from the interface to DefaultImpls, since this is where kotlin-reflect looks for it.
|
||||
val localDelegatedProperties = context.localDelegatedProperties[irClass.attributeOwnerId as IrClass]
|
||||
if (localDelegatedProperties != null) {
|
||||
context.localDelegatedProperties[defaultImplsIrClass.attributeOwnerId as IrClass] = localDelegatedProperties
|
||||
context.localDelegatedProperties[irClass.attributeOwnerId as IrClass] = emptyList<IrLocalDelegatedPropertySymbol>()
|
||||
}
|
||||
|
||||
// Move $$delegatedProperties array and $assertionsDisabled field
|
||||
for (field in irClass.declarations.filterIsInstance<IrField>()) {
|
||||
if (field.origin != JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE && field.origin != JvmLoweredDeclarationOrigin.GENERATED_ASSERTION_ENABLED_FIELD)
|
||||
|
||||
Reference in New Issue
Block a user