[IR] Remove deprecated correspondingProperty from IrField

This commit is contained in:
Roman Artemev
2019-11-07 16:35:13 +03:00
committed by romanart
parent 646df8d40a
commit 63110ab636
5 changed files with 3 additions and 20 deletions
@@ -25,9 +25,6 @@ interface IrField :
var initializer: IrExpressionBody?
@Deprecated("Use correspondingPropertySymbol")
var correspondingProperty: IrProperty?
var correspondingPropertySymbol: IrPropertySymbol?
override val metadata: MetadataSource.Property?
@@ -82,13 +82,6 @@ class IrFieldImpl(
override var initializer: IrExpressionBody? = null
@Suppress("OverridingDeprecatedMember")
override var correspondingProperty: IrProperty?
get() = correspondingPropertySymbol?.owner
set(value) {
correspondingPropertySymbol = value?.symbol
}
override var correspondingPropertySymbol: IrPropertySymbol? = null
override val overriddenSymbols: MutableList<IrFieldSymbol> = mutableListOf()
@@ -89,13 +89,6 @@ class IrLazyField(
}
}
@Suppress("OverridingDeprecatedMember")
override var correspondingProperty: IrProperty?
get() = correspondingPropertySymbol?.owner
set(value) {
correspondingPropertySymbol = value?.symbol
}
override var correspondingPropertySymbol: IrPropertySymbol? by lazyVar {
stubGenerator.generatePropertyStub(descriptor).symbol
}
@@ -64,7 +64,7 @@ open class DescriptorReferenceSerializer(
val (packageFqName, classFqName) = extractPackageAndClassFqns(descriptor) ?: return null
val isAccessor = declaration.isAccessor
val isBackingField = declaration is IrField && declaration.correspondingProperty != null
val isBackingField = declaration is IrField && declaration.correspondingPropertySymbol != null
val isFakeOverride = declaration.origin == IrDeclarationOrigin.FAKE_OVERRIDE
val isDefaultConstructor = descriptor is ClassConstructorDescriptor && containingDeclaration is ClassDescriptor && (containingDeclaration.kind == ClassKind.OBJECT)
val isEnumEntry = descriptor is ClassDescriptor && descriptor.kind == ClassKind.ENUM_ENTRY
@@ -90,7 +90,7 @@ open class DescriptorReferenceSerializer(
val discoverableDescriptorsDeclaration: IrDeclaration? = if (isAccessor) {
(realDeclaration as IrSimpleFunction).correspondingPropertySymbol!!.owner
} else if (isBackingField) {
(realDeclaration as IrField).correspondingProperty!!
(realDeclaration as IrField).correspondingPropertySymbol!!.owner
} else if (isDefaultConstructor || isEnumEntry) {
null
} else {
@@ -136,7 +136,7 @@ open class SerializerIrGenerator(val irClass: IrClass, final override val compil
+addFieldCall(classProp)
// add property annotations
copySerialInfoAnnotationsToDescriptor(
classProp.irField.correspondingProperty?.annotations.orEmpty(),
classProp.irField.correspondingPropertySymbol?.owner?.annotations.orEmpty(),
localDescriptor,
serialDescImplClass.referenceMethod(CallingConventions.addAnnotation)
)