Introduce PropertyDescriptor.isDelegated, write new flag to metadata
#KT-8384 In Progress
This commit is contained in:
@@ -301,6 +301,8 @@ message Property {
|
||||
isConst
|
||||
lateinit
|
||||
hasConstant
|
||||
isExternal
|
||||
isDelegated
|
||||
*/
|
||||
optional int32 flags = 11 [default = 518 /* public (6) final property with getter (512) */];
|
||||
optional int32 old_flags = 1 [default = 2054];
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.protobuf.Internal;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
|
||||
public class Flags {
|
||||
private Flags() {}
|
||||
@@ -67,6 +66,7 @@ public class Flags {
|
||||
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);
|
||||
public static final BooleanFlagField IS_DELEGATED = FlagField.booleanAfter(IS_EXTERNAL_PROPERTY);
|
||||
|
||||
// Parameters
|
||||
|
||||
@@ -173,7 +173,8 @@ public class Flags {
|
||||
boolean hasConstant,
|
||||
boolean isConst,
|
||||
boolean lateInit,
|
||||
boolean isExternal
|
||||
boolean isExternal,
|
||||
boolean isDelegated
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
| VISIBILITY.toFlags(visibility(visibility))
|
||||
@@ -186,6 +187,7 @@ public class Flags {
|
||||
| IS_LATEINIT.toFlags(lateInit)
|
||||
| HAS_CONSTANT.toFlags(hasConstant)
|
||||
| IS_EXTERNAL_PROPERTY.toFlags(isExternal)
|
||||
| IS_DELEGATED.toFlags(isDelegated)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -15322,6 +15322,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasFlags();
|
||||
@@ -15339,6 +15341,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
int getFlags();
|
||||
@@ -15664,6 +15668,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -15683,6 +15689,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -16371,6 +16379,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasFlags() {
|
||||
@@ -16390,6 +16400,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public int getFlags() {
|
||||
@@ -16409,6 +16421,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setFlags(int value) {
|
||||
@@ -16431,6 +16445,8 @@ public final class ProtoBuf {
|
||||
*isConst
|
||||
*lateinit
|
||||
*hasConstant
|
||||
*isExternal
|
||||
*isDelegated
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearFlags() {
|
||||
|
||||
+1
@@ -47,6 +47,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
||||
Flags.IS_LATEINIT.get(flags),
|
||||
Flags.IS_CONST.get(flags),
|
||||
Flags.IS_EXTERNAL_PROPERTY.get(flags),
|
||||
Flags.IS_DELEGATED.get(flags),
|
||||
proto,
|
||||
c.nameResolver,
|
||||
c.typeTable,
|
||||
|
||||
+3
-1
@@ -105,6 +105,7 @@ class DeserializedPropertyDescriptor(
|
||||
isLateInit: Boolean,
|
||||
isConst: Boolean,
|
||||
isExternal: Boolean,
|
||||
isDelegated: Boolean,
|
||||
override val proto: ProtoBuf.Property,
|
||||
override val nameResolver: NameResolver,
|
||||
override val typeTable: TypeTable,
|
||||
@@ -113,7 +114,7 @@ class DeserializedPropertyDescriptor(
|
||||
) : DeserializedCallableMemberDescriptor,
|
||||
PropertyDescriptorImpl(containingDeclaration, original, annotations,
|
||||
modality, visibility, isVar, name, kind, SourceElement.NO_SOURCE, isLateInit, isConst, false, false,
|
||||
isExternal) {
|
||||
isExternal, isDelegated) {
|
||||
|
||||
override fun createSubstitutedCopy(
|
||||
newOwner: DeclarationDescriptor,
|
||||
@@ -124,6 +125,7 @@ class DeserializedPropertyDescriptor(
|
||||
): PropertyDescriptorImpl {
|
||||
return DeserializedPropertyDescriptor(
|
||||
newOwner, original, annotations, newModality, newVisibility, isVar, name, kind, isLateInit, isConst, isExternal,
|
||||
@Suppress("DEPRECATION") isDelegated,
|
||||
proto, nameResolver, typeTable, sinceKotlinInfoTable, containerSource
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user