Value classes: Add isValue property to class descriptors
Reuse isInline flag in proto and IR. Check metadata version on deserialization.
This commit is contained in:
@@ -604,6 +604,9 @@ open class IrBasedClassDescriptor(owner: IrClass) : ClassDescriptor, IrBasedDecl
|
||||
|
||||
override fun isFun() = owner.isFun
|
||||
|
||||
// In IR, inline and value are synonyms
|
||||
override fun isValue() = owner.isInline
|
||||
|
||||
override fun getThisAsReceiverParameter() = owner.thisReceiver?.toIrBasedDescriptor() as ReceiverParameterDescriptor
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor() =
|
||||
@@ -704,6 +707,8 @@ open class IrBasedEnumEntryDescriptor(owner: IrEnumEntry) : ClassDescriptor, IrB
|
||||
|
||||
override fun isFun() = false
|
||||
|
||||
override fun isValue() = false
|
||||
|
||||
override fun getThisAsReceiverParameter() = (owner.parent as IrClass).toIrBasedDescriptor().thisAsReceiverParameter
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor(): ClassConstructorDescriptor? {
|
||||
|
||||
@@ -583,6 +583,8 @@ open class WrappedClassDescriptor : ClassDescriptor, WrappedDeclarationDescripto
|
||||
|
||||
override fun isFun() = owner.isFun
|
||||
|
||||
override fun isValue() = owner.isInline
|
||||
|
||||
override fun getThisAsReceiverParameter() = owner.thisReceiver?.descriptor as ReceiverParameterDescriptor
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor() =
|
||||
@@ -682,6 +684,8 @@ open class WrappedScriptDescriptor : ScriptDescriptor, WrappedDeclarationDescrip
|
||||
|
||||
override fun isFun() = false
|
||||
|
||||
override fun isValue() = false
|
||||
|
||||
override fun getThisAsReceiverParameter() = owner.thisReceiver.descriptor as ReceiverParameterDescriptor
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor() = TODO()
|
||||
@@ -822,6 +826,8 @@ open class WrappedEnumEntryDescriptor : ClassDescriptor, WrappedDeclarationDescr
|
||||
|
||||
override fun isFun() = false
|
||||
|
||||
override fun isValue() = false
|
||||
|
||||
override fun getThisAsReceiverParameter() = (owner.parent as IrClass).descriptor.thisAsReceiverParameter
|
||||
|
||||
override fun getUnsubstitutedPrimaryConstructor(): ClassConstructorDescriptor? {
|
||||
|
||||
Reference in New Issue
Block a user