Add external property to class and property descriptors
This commit is contained in:
@@ -35,6 +35,7 @@ public class Flags {
|
||||
public static final FlagField<ProtoBuf.Class.Kind> CLASS_KIND = FlagField.after(MODALITY, ProtoBuf.Class.Kind.values());
|
||||
public static final BooleanFlagField IS_INNER = FlagField.booleanAfter(CLASS_KIND);
|
||||
public static final BooleanFlagField IS_DATA = FlagField.booleanAfter(IS_INNER);
|
||||
public static final BooleanFlagField IS_EXTERNAL_CLASS = FlagField.booleanAfter(IS_DATA);
|
||||
|
||||
// Constructors
|
||||
|
||||
@@ -61,6 +62,7 @@ public class Flags {
|
||||
public static final BooleanFlagField IS_CONST = FlagField.booleanAfter(HAS_SETTER);
|
||||
public static final BooleanFlagField IS_LATEINIT = FlagField.booleanAfter(IS_CONST);
|
||||
public static final BooleanFlagField HAS_CONSTANT = FlagField.booleanAfter(IS_LATEINIT);
|
||||
public static final BooleanFlagField IS_EXTERNAL_PROPERTY = FlagField.booleanAfter(HAS_CONSTANT);
|
||||
|
||||
// Parameters
|
||||
|
||||
|
||||
+1
@@ -46,6 +46,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
Deserialization.memberKind(Flags.MEMBER_KIND.get(flags)),
|
||||
Flags.IS_LATEINIT.get(flags),
|
||||
Flags.IS_CONST.get(flags),
|
||||
Flags.IS_EXTERNAL_PROPERTY.get(flags),
|
||||
proto,
|
||||
c.nameResolver,
|
||||
c.typeTable,
|
||||
|
||||
+2
-1
@@ -86,7 +86,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
name: Name,
|
||||
private val isInner: Boolean,
|
||||
numberOfDeclaredTypeParameters: Int
|
||||
) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE) {
|
||||
) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE, /* isExternal = */ false) {
|
||||
private val typeParameters = createTypeParameters(this, numberOfDeclaredTypeParameters)
|
||||
|
||||
private val typeConstructor = ClassTypeConstructorImpl(this, /* isFinal = */ true, typeParameters, setOf(module.builtIns.anyType))
|
||||
@@ -102,6 +102,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
override fun isData() = false
|
||||
override fun isPlatform() = false
|
||||
override fun isImpl() = false
|
||||
override fun isExternal() = false
|
||||
override val annotations: Annotations get() = Annotations.EMPTY
|
||||
|
||||
override fun getUnsubstitutedMemberScope() = MemberScope.Empty
|
||||
|
||||
+2
@@ -99,6 +99,8 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun isImpl() = false
|
||||
|
||||
override fun isExternal() = Flags.IS_EXTERNAL_CLASS.get(classProto.flags)
|
||||
|
||||
override fun getUnsubstitutedMemberScope(): MemberScope = memberScope
|
||||
|
||||
override fun getStaticScope() = staticScope
|
||||
|
||||
+7
-2
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.protobuf.MessageLite
|
||||
import org.jetbrains.kotlin.serialization.Flags
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||
import org.jetbrains.kotlin.serialization.deserialization.TypeTable
|
||||
@@ -87,13 +88,15 @@ class DeserializedPropertyDescriptor(
|
||||
kind: CallableMemberDescriptor.Kind,
|
||||
isLateInit: Boolean,
|
||||
isConst: Boolean,
|
||||
isExternal: Boolean,
|
||||
override val proto: ProtoBuf.Property,
|
||||
override val nameResolver: NameResolver,
|
||||
override val typeTable: TypeTable,
|
||||
override val containerSource: DeserializedContainerSource?
|
||||
) : DeserializedCallableMemberDescriptor,
|
||||
PropertyDescriptorImpl(containingDeclaration, original, annotations,
|
||||
modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE, isLateInit, isConst, false, false) {
|
||||
modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE, isLateInit, isConst, false, false,
|
||||
isExternal) {
|
||||
|
||||
override fun createSubstitutedCopy(
|
||||
newOwner: DeclarationDescriptor,
|
||||
@@ -103,10 +106,12 @@ class DeserializedPropertyDescriptor(
|
||||
kind: CallableMemberDescriptor.Kind
|
||||
): PropertyDescriptorImpl {
|
||||
return DeserializedPropertyDescriptor(
|
||||
newOwner, original, annotations, newModality, newVisibility, isVar, name, kind, isLateInit, isConst,
|
||||
newOwner, original, annotations, newModality, newVisibility, isVar, name, kind, isLateInit, isConst, isExternal,
|
||||
proto, nameResolver, typeTable, containerSource
|
||||
)
|
||||
}
|
||||
|
||||
override fun isExternal() = Flags.IS_EXTERNAL_PROPERTY.get(proto.flags)
|
||||
}
|
||||
|
||||
class DeserializedClassConstructorDescriptor(
|
||||
|
||||
Reference in New Issue
Block a user