[Psi2Ir] Fix Lazy Fake override field

- add comment about problem with DeserializedPropertyDescriptor
This commit is contained in:
Roman Artemev
2019-08-21 18:27:12 +03:00
committed by romanart
parent f2a5ab8c16
commit 1cdff7810e
2 changed files with 6 additions and 1 deletions
@@ -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
}
@@ -65,7 +65,11 @@ class IrLazyField(
override val descriptor: PropertyDescriptor = symbol.descriptor
override val overriddenSymbols: MutableList<IrFieldSymbol> = mutableListOf()
override val overriddenSymbols: MutableList<IrFieldSymbol> by lazy {
symbol.descriptor.overriddenDescriptors.map {
stubGenerator.generateFieldStub(it.original).symbol
}.toMutableList()
}
override var type: IrType by lazyVar {
descriptor.type.toIrType()