diff --git a/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java b/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java
index 06a51bb294c..726d9f82e2e 100644
--- a/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java
+++ b/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java
@@ -31230,7 +31230,7 @@ public final class DebugProtoBuf {
org.jetbrains.kotlin.protobuf.MessageOrBuilder {
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -31239,7 +31239,7 @@ public final class DebugProtoBuf {
*/
boolean hasFlags();
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -31673,7 +31673,7 @@ public final class DebugProtoBuf {
public static final int FLAGS_FIELD_NUMBER = 1;
private int flags_;
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -31684,7 +31684,7 @@ public final class DebugProtoBuf {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -32365,7 +32365,7 @@ public final class DebugProtoBuf {
private int flags_ ;
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -32376,7 +32376,7 @@ public final class DebugProtoBuf {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -32387,7 +32387,7 @@ public final class DebugProtoBuf {
return flags_;
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -32401,7 +32401,7 @@ public final class DebugProtoBuf {
return this;
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -33700,24 +33700,24 @@ public final class DebugProtoBuf {
"\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n\020RETU" +
"RNS_NOT_NULL\020\002\"G\n\016InvocationKind\022\020\n\014AT_M" +
"OST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_LEAST" +
- "_ONCE\020\002\"\234\003\n\nExpression\022\r\n\005flags\030\001 \001(\005\022!\n",
- "\031value_parameter_reference\030\002 \001(\005\022O\n\016cons" +
- "tant_value\030\003 \001(\01627.org.jetbrains.kotlin." +
- "metadata.Expression.ConstantValue\022=\n\020is_" +
- "instance_type\030\004 \001(\0132#.org.jetbrains.kotl" +
- "in.metadata.Type\022\033\n\023is_instance_type_id\030" +
- "\005 \001(\005\022?\n\014and_argument\030\006 \003(\0132).org.jetbra" +
- "ins.kotlin.metadata.Expression\022>\n\013or_arg" +
- "ument\030\007 \003(\0132).org.jetbrains.kotlin.metad" +
- "ata.Expression\".\n\rConstantValue\022\010\n\004TRUE\020" +
- "\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n\005FI",
- "NAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020" +
- "\003*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE" +
- "\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE" +
- "_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013D" +
- "ECLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEG" +
- "ATION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBu" +
- "f"
+ "_ONCE\020\002\"\237\003\n\nExpression\022\020\n\005flags\030\001 \001(\005:\0010",
+ "\022!\n\031value_parameter_reference\030\002 \001(\005\022O\n\016c" +
+ "onstant_value\030\003 \001(\01627.org.jetbrains.kotl" +
+ "in.metadata.Expression.ConstantValue\022=\n\020" +
+ "is_instance_type\030\004 \001(\0132#.org.jetbrains.k" +
+ "otlin.metadata.Type\022\033\n\023is_instance_type_" +
+ "id\030\005 \001(\005\022?\n\014and_argument\030\006 \003(\0132).org.jet" +
+ "brains.kotlin.metadata.Expression\022>\n\013or_" +
+ "argument\030\007 \003(\0132).org.jetbrains.kotlin.me" +
+ "tadata.Expression\".\n\rConstantValue\022\010\n\004TR" +
+ "UE\020\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n",
+ "\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEAL" +
+ "ED\020\003*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIV" +
+ "ATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIV" +
+ "ATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017" +
+ "\n\013DECLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDE" +
+ "LEGATION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProt" +
+ "oBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
diff --git a/compiler/frontend/src/org/jetbrains/kotlin/contracts/ContractDeserializerImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/contracts/ContractDeserializerImpl.kt
index 990c0ae2a6b..b0da134594c 100644
--- a/compiler/frontend/src/org/jetbrains/kotlin/contracts/ContractDeserializerImpl.kt
+++ b/compiler/frontend/src/org/jetbrains/kotlin/contracts/ContractDeserializerImpl.kt
@@ -117,7 +117,7 @@ class ContractDeserializerImpl(private val configuration: DeserializationConfigu
}
private fun extractPrimitiveExpression(proto: ProtoBuf.Expression, primitiveType: PrimitiveExpressionType?): BooleanExpression? {
- val isInverted = proto.hasFlags() && Flags.IS_NEGATED.get(proto.flags)
+ val isInverted = Flags.IS_NEGATED.get(proto.flags)
return when (primitiveType) {
PrimitiveExpressionType.VALUE_PARAMETER_REFERENCE, PrimitiveExpressionType.RECEIVER_REFERENCE -> {
@@ -200,7 +200,7 @@ class ContractDeserializerImpl(private val configuration: DeserializationConfigu
proto.hasValueParameterReference() && proto.hasType() ->
expressionTypes.add(PrimitiveExpressionType.INSTANCE_CHECK)
- proto.hasValueParameterReference() && proto.hasFlag(Flags.IS_NULL_CHECK_PREDICATE) ->
+ proto.hasValueParameterReference() && Flags.IS_NULL_CHECK_PREDICATE.get(proto.flags) ->
expressionTypes.add(PrimitiveExpressionType.NULLABILITY_CHECK)
}
@@ -226,9 +226,6 @@ class ContractDeserializerImpl(private val configuration: DeserializationConfigu
private fun ProtoBuf.Expression.hasType(): Boolean = this.hasIsInstanceType() || this.hasIsInstanceTypeId()
- private fun ProtoBuf.Expression.hasFlag(flag: Flags.BooleanFlagField) =
- this.hasFlags() && flag.get(this.flags)
-
// Arguments of expressions with such types are never other expressions
private enum class PrimitiveExpressionType {
VALUE_PARAMETER_REFERENCE,
@@ -247,4 +244,4 @@ class ContractDeserializerImpl(private val configuration: DeserializationConfigu
OR_SEQUENCE
}
}
-}
\ No newline at end of file
+}
diff --git a/core/metadata/src/metadata.proto b/core/metadata/src/metadata.proto
index 64449567e40..5c1cf1e42d3 100644
--- a/core/metadata/src/metadata.proto
+++ b/core/metadata/src/metadata.proto
@@ -525,7 +525,7 @@ message Expression {
isNegated => this expression should be negated
isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
*/
- optional int32 flags = 1;
+ optional int32 flags = 1 [default = 0];
// stored as index in valueParameters list of owner-function in 1-indexation
// Index '0' is reserved for extension receiver
diff --git a/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java b/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java
index 0267ecf900a..6342b24741b 100644
--- a/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java
+++ b/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java
@@ -24029,7 +24029,7 @@ public final class ProtoBuf {
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24038,7 +24038,7 @@ public final class ProtoBuf {
*/
boolean hasFlags();
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24386,7 +24386,7 @@ public final class ProtoBuf {
public static final int FLAGS_FIELD_NUMBER = 1;
private int flags_;
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24397,7 +24397,7 @@ public final class ProtoBuf {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24971,7 +24971,7 @@ public final class ProtoBuf {
private int flags_ ;
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24982,7 +24982,7 @@ public final class ProtoBuf {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -24993,7 +24993,7 @@ public final class ProtoBuf {
return flags_;
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated
@@ -25007,7 +25007,7 @@ public final class ProtoBuf {
return this;
}
/**
- * optional int32 flags = 1;
+ * optional int32 flags = 1 [default = 0];
*
*
*isNegated => this expression should be negated