JVM IR: Move $assertionsDisabled field to interface DefaultImpls
This commit is contained in:
committed by
Ilmir Usmanov
parent
0ed719f792
commit
3cf71c1d2b
+9
-8
@@ -161,14 +161,15 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
|||||||
context.localDelegatedProperties[irClass.attributeOwnerId as IrClass] = emptyList<IrLocalDelegatedPropertySymbol>()
|
context.localDelegatedProperties[irClass.attributeOwnerId as IrClass] = emptyList<IrLocalDelegatedPropertySymbol>()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move $$delegatedProperties array
|
// Move $$delegatedProperties array and $assertionsDisabled field
|
||||||
val delegatedPropertyArray = irClass.declarations.filterIsInstance<IrField>()
|
for (field in irClass.declarations.filterIsInstance<IrField>()) {
|
||||||
.singleOrNull { it.origin == JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE }
|
if (field.origin != JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE && field.origin != JvmLoweredDeclarationOrigin.GENERATED_ASSERTION_ENABLED_FIELD)
|
||||||
if (delegatedPropertyArray != null) {
|
continue
|
||||||
irClass.declarations.remove(delegatedPropertyArray)
|
|
||||||
defaultImplsIrClass.declarations.add(0, delegatedPropertyArray)
|
irClass.declarations.remove(field)
|
||||||
delegatedPropertyArray.parent = defaultImplsIrClass
|
defaultImplsIrClass.declarations.add(0, field)
|
||||||
delegatedPropertyArray.initializer?.patchDeclarationParents(defaultImplsIrClass)
|
field.parent = defaultImplsIrClass
|
||||||
|
field.initializer?.patchDeclarationParents(defaultImplsIrClass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user