FIR: record use of backing field symbol to indeed add a backing field
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0cc3762f9a
commit
3e9ac75cfc
+4
-2
@@ -676,8 +676,10 @@ class Fir2IrDeclarationStorage(
|
||||
val setter = property.setter
|
||||
// TODO: this checks are very preliminary, FIR resolve should determine backing field presence itself
|
||||
if (property.isConst || (property.modality != Modality.ABSTRACT && (irParent !is IrClass || !irParent.isInterface))) {
|
||||
if (initializer != null || getter is FirDefaultPropertyGetter ||
|
||||
property.isVar && setter is FirDefaultPropertySetter
|
||||
if (initializer != null ||
|
||||
getter is FirDefaultPropertyGetter ||
|
||||
property.isVar && setter is FirDefaultPropertySetter ||
|
||||
property.backingFieldSymbol.isReferenced
|
||||
) {
|
||||
backingField = createBackingField(
|
||||
property, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, descriptor,
|
||||
|
||||
Reference in New Issue
Block a user