[Psi2Ir] Fix Lazy Fake override field
- add comment about problem with DeserializedPropertyDescriptor
This commit is contained in:
@@ -13,6 +13,7 @@ fun PropertyDescriptor.hasBackingField(bindingContext: BindingContext?): Boolean
|
|||||||
kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE -> overriddenDescriptors.any { it.hasBackingField(bindingContext) }
|
kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE -> overriddenDescriptors.any { it.hasBackingField(bindingContext) }
|
||||||
source is KotlinSourceElement && bindingContext != null -> bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, this) ?: false
|
source is KotlinSourceElement && bindingContext != null -> bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, this) ?: false
|
||||||
compileTimeInitializer != null -> true
|
compileTimeInitializer != null -> true
|
||||||
|
// backingField != null -> true // TODO: in case of DeserializedPropetyDescriptor this function returns incorrect result for FO field
|
||||||
getter != null -> false
|
getter != null -> false
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,11 @@ class IrLazyField(
|
|||||||
|
|
||||||
override val descriptor: PropertyDescriptor = symbol.descriptor
|
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 {
|
override var type: IrType by lazyVar {
|
||||||
descriptor.type.toIrType()
|
descriptor.type.toIrType()
|
||||||
|
|||||||
Reference in New Issue
Block a user