KT-52551 Create a static initialization section in case of delegation to a property reference from a file class
This commit is contained in:
committed by
teamcity
parent
0b9e5e14be
commit
2ceccec2b8
+7
-1
@@ -172,7 +172,13 @@ private class PropertyReferenceDelegationTransformer(val context: JvmBackendCont
|
||||
// When the receiver is inlined, it can have side effects in form of class initialization, so it should be evaluated here.
|
||||
val receiverBlock = receiver.takeIf { backingField == null }?.let {
|
||||
val symbol = IrAnonymousInitializerSymbolImpl(parentAsClass.symbol)
|
||||
context.irFactory.createAnonymousInitializer(it.startOffset, it.endOffset, IrDeclarationOrigin.DEFINED, symbol).apply {
|
||||
context.irFactory.createAnonymousInitializer(
|
||||
it.startOffset,
|
||||
it.endOffset,
|
||||
IrDeclarationOrigin.DEFINED,
|
||||
symbol,
|
||||
parentAsClass.isFacadeClass
|
||||
).apply {
|
||||
body = context.irFactory.createBlockBody(startOffset, endOffset, listOf(it.inline(null, null)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user