diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/resolveUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/resolveUtil.kt index 277e14a44a5..87a703940f5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/resolveUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/resolveUtil.kt @@ -13,6 +13,7 @@ fun PropertyDescriptor.hasBackingField(bindingContext: BindingContext?): Boolean kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE -> overriddenDescriptors.any { it.hasBackingField(bindingContext) } source is KotlinSourceElement && bindingContext != null -> bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, this) ?: false compileTimeInitializer != null -> true +// backingField != null -> true // TODO: in case of DeserializedPropetyDescriptor this function returns incorrect result for FO field getter != null -> false else -> true } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt index 1bddb733881..3d72394044b 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt @@ -65,7 +65,11 @@ class IrLazyField( override val descriptor: PropertyDescriptor = symbol.descriptor - override val overriddenSymbols: MutableList = mutableListOf() + override val overriddenSymbols: MutableList by lazy { + symbol.descriptor.overriddenDescriptors.map { + stubGenerator.generateFieldStub(it.original).symbol + }.toMutableList() + } override var type: IrType by lazyVar { descriptor.type.toIrType()