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:
+1
@@ -83,6 +83,7 @@ class SyntheticClassOrObjectDescriptor(
|
||||
override fun isExpect() = false
|
||||
override fun isActual() = false
|
||||
override fun isFun() = false
|
||||
override fun isValue() = false
|
||||
|
||||
override fun getCompanionObjectDescriptor(): ClassDescriptorWithResolutionScopes? = null
|
||||
override fun getTypeConstructor(): TypeConstructor = typeConstructor
|
||||
|
||||
+7
@@ -87,6 +87,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
private final boolean isExpect;
|
||||
private final boolean isActual;
|
||||
private final boolean isFun;
|
||||
private final boolean isValue;
|
||||
|
||||
private final Annotations annotations;
|
||||
private final Annotations danglingAnnotations;
|
||||
@@ -160,6 +161,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).isExpect();
|
||||
|
||||
this.isFun = modifierList != null && PsiUtilsKt.hasFunModifier(modifierList);
|
||||
this.isValue = modifierList != null && PsiUtilsKt.hasValueModifier(modifierList);
|
||||
|
||||
// Annotation entries are taken from both own annotations (if any) and object literal annotations (if any)
|
||||
List<KtAnnotationEntry> annotationEntries = new ArrayList<>();
|
||||
@@ -552,6 +554,11 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
return isFun;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValue() {
|
||||
return isValue;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Annotations getAnnotations() {
|
||||
|
||||
Reference in New Issue
Block a user