diff --git a/build-common/src/org/jetbrains/kotlin/incremental/ProtoCompareGenerated.kt b/build-common/src/org/jetbrains/kotlin/incremental/ProtoCompareGenerated.kt index 90221df2c88..73e00a1eab0 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/ProtoCompareGenerated.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/ProtoCompareGenerated.kt @@ -201,10 +201,11 @@ open class ProtoCompareGenerated( if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) return false } - if (old.hasMultiFieldValueClassRepresentation() != new.hasMultiFieldValueClassRepresentation()) return false - if (old.hasMultiFieldValueClassRepresentation()) { - if (!checkEquals(old.multiFieldValueClassRepresentation, new.multiFieldValueClassRepresentation)) return false - } + if (!checkEqualsClassMultiFieldValueClassUnderlyingName(old, new)) return false + + if (!checkEqualsClassMultiFieldValueClassUnderlyingType(old, new)) return false + + if (!checkEqualsClassMultiFieldValueClassUnderlyingTypeId(old, new)) return false if (!checkEqualsClassVersionRequirement(old, new)) return false @@ -295,7 +296,9 @@ open class ProtoCompareGenerated( INLINE_CLASS_UNDERLYING_PROPERTY_NAME, INLINE_CLASS_UNDERLYING_TYPE, INLINE_CLASS_UNDERLYING_TYPE_ID, - MULTI_FIELD_VALUE_CLASS_REPRESENTATION, + MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_LIST, + MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_LIST, + MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_ID_LIST, VERSION_REQUIREMENT_LIST, VERSION_REQUIREMENT_TABLE, JVM_EXT_CLASS_MODULE_NAME, @@ -363,10 +366,11 @@ open class ProtoCompareGenerated( if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID) } - if (old.hasMultiFieldValueClassRepresentation() != new.hasMultiFieldValueClassRepresentation()) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_REPRESENTATION) - if (old.hasMultiFieldValueClassRepresentation()) { - if (!checkEquals(old.multiFieldValueClassRepresentation, new.multiFieldValueClassRepresentation)) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_REPRESENTATION) - } + if (!checkEqualsClassMultiFieldValueClassUnderlyingName(old, new)) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_LIST) + + if (!checkEqualsClassMultiFieldValueClassUnderlyingType(old, new)) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_LIST) + + if (!checkEqualsClassMultiFieldValueClassUnderlyingTypeId(old, new)) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_ID_LIST) if (!checkEqualsClassVersionRequirement(old, new)) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_LIST) @@ -1026,12 +1030,6 @@ open class ProtoCompareGenerated( return true } - open fun checkEquals(old: ProtoBuf.Class.MultiFieldValueClassRepresentation, new: ProtoBuf.Class.MultiFieldValueClassRepresentation): Boolean { - if (!checkEqualsClassMultiFieldValueClassRepresentationProperty(old, new)) return false - - return true - } - open fun checkEquals(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean { if (!checkClassIdEquals(old.id, new.id)) return false @@ -1256,22 +1254,6 @@ open class ProtoCompareGenerated( return true } - open fun checkEquals(old: ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty, new: ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty): Boolean { - if (old.name != new.name) return false - - if (old.hasType() != new.hasType()) return false - if (old.hasType()) { - if (!checkEquals(old.type, new.type)) return false - } - - if (old.hasTypeId() != new.hasTypeId()) return false - if (old.hasTypeId()) { - if (old.typeId != new.typeId) return false - } - - return true - } - open fun checkEquals(old: ProtoBuf.Annotation.Argument, new: ProtoBuf.Annotation.Argument): Boolean { if (!checkStringEquals(old.nameId, new.nameId)) return false @@ -1498,6 +1480,36 @@ open class ProtoCompareGenerated( return true } + open fun checkEqualsClassMultiFieldValueClassUnderlyingName(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean { + if (old.multiFieldValueClassUnderlyingNameCount != new.multiFieldValueClassUnderlyingNameCount) return false + + for(i in 0..old.multiFieldValueClassUnderlyingNameCount - 1) { + if (!checkStringEquals(old.getMultiFieldValueClassUnderlyingName(i), new.getMultiFieldValueClassUnderlyingName(i))) return false + } + + return true + } + + open fun checkEqualsClassMultiFieldValueClassUnderlyingType(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean { + if (old.multiFieldValueClassUnderlyingTypeCount != new.multiFieldValueClassUnderlyingTypeCount) return false + + for(i in 0..old.multiFieldValueClassUnderlyingTypeCount - 1) { + if (!checkEquals(old.getMultiFieldValueClassUnderlyingType(i), new.getMultiFieldValueClassUnderlyingType(i))) return false + } + + return true + } + + open fun checkEqualsClassMultiFieldValueClassUnderlyingTypeId(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean { + if (old.multiFieldValueClassUnderlyingTypeIdCount != new.multiFieldValueClassUnderlyingTypeIdCount) return false + + for(i in 0..old.multiFieldValueClassUnderlyingTypeIdCount - 1) { + if (!checkEquals(oldTypeTable.getType(old.getMultiFieldValueClassUnderlyingTypeId(i)), newTypeTable.getType(new.getMultiFieldValueClassUnderlyingTypeId(i)))) return false + } + + return true + } + open fun checkEqualsClassVersionRequirement(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean { if (old.versionRequirementCount != new.versionRequirementCount) return false @@ -1688,16 +1700,6 @@ open class ProtoCompareGenerated( return true } - open fun checkEqualsClassMultiFieldValueClassRepresentationProperty(old: ProtoBuf.Class.MultiFieldValueClassRepresentation, new: ProtoBuf.Class.MultiFieldValueClassRepresentation): Boolean { - if (old.propertyCount != new.propertyCount) return false - - for(i in 0..old.propertyCount - 1) { - if (!checkEquals(old.getProperty(i), new.getProperty(i))) return false - } - - return true - } - open fun checkEqualsAnnotationArgument(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean { if (old.argumentCount != new.argumentCount) return false @@ -1907,8 +1909,16 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> hashCode = 31 * hashCode + typeById(inlineClassUnderlyingTypeId).hashCode(stringIndexes, fqNameIndexes, typeById) } - if (hasMultiFieldValueClassRepresentation()) { - hashCode = 31 * hashCode + multiFieldValueClassRepresentation.hashCode(stringIndexes, fqNameIndexes, typeById) + for(i in 0..multiFieldValueClassUnderlyingNameCount - 1) { + hashCode = 31 * hashCode + stringIndexes(getMultiFieldValueClassUnderlyingName(i)) + } + + for(i in 0..multiFieldValueClassUnderlyingTypeCount - 1) { + hashCode = 31 * hashCode + getMultiFieldValueClassUnderlyingType(i).hashCode(stringIndexes, fqNameIndexes, typeById) + } + + for(i in 0..multiFieldValueClassUnderlyingTypeIdCount - 1) { + hashCode = 31 * hashCode + typeById(getMultiFieldValueClassUnderlyingTypeId(i)).hashCode(stringIndexes, fqNameIndexes, typeById) } for(i in 0..versionRequirementCount - 1) { @@ -2412,16 +2422,6 @@ fun ProtoBuf.EnumEntry.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int return hashCode } -fun ProtoBuf.Class.MultiFieldValueClassRepresentation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeById: (Int) -> ProtoBuf.Type): Int { - var hashCode = 1 - - for(i in 0..propertyCount - 1) { - hashCode = 31 * hashCode + getProperty(i).hashCode(stringIndexes, fqNameIndexes, typeById) - } - - return hashCode -} - fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeById: (Int) -> ProtoBuf.Type): Int { var hashCode = 1 @@ -2622,22 +2622,6 @@ fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: return hashCode } -fun ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeById: (Int) -> ProtoBuf.Type): Int { - var hashCode = 1 - - hashCode = 31 * hashCode + name - - if (hasType()) { - hashCode = 31 * hashCode + type.hashCode(stringIndexes, fqNameIndexes, typeById) - } - - if (hasTypeId()) { - hashCode = 31 * hashCode + typeId - } - - return hashCode -} - fun ProtoBuf.Annotation.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeById: (Int) -> ProtoBuf.Type): Int { var hashCode = 1 diff --git a/build-common/src/org/jetbrains/kotlin/incremental/protoDifferenceUtils.kt b/build-common/src/org/jetbrains/kotlin/incremental/protoDifferenceUtils.kt index 0ac11e26578..06ec105f7e5 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/protoDifferenceUtils.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/protoDifferenceUtils.kt @@ -292,7 +292,9 @@ class DifferenceCalculatorForClass( ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME, ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE, ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID, - ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_REPRESENTATION -> { + ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_LIST, + ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_LIST, + ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_ID_LIST -> { isClassAffected = true } ProtoBufClassKind.CONTEXT_RECEIVER_TYPE_LIST, diff --git a/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java b/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java index b4521733772..80550e0f7b2 100644 --- a/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java +++ b/build-common/test/org/jetbrains/kotlin/metadata/DebugProtoBuf.java @@ -10424,17 +10424,54 @@ public final class DebugProtoBuf { int getInlineClassUnderlyingTypeId(); /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - boolean hasMultiFieldValueClassRepresentation(); + java.util.List getMultiFieldValueClassUnderlyingNameList(); /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation(); + int getMultiFieldValueClassUnderlyingNameCount(); /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder getMultiFieldValueClassRepresentationOrBuilder(); + int getMultiFieldValueClassUnderlyingName(int index); + + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + java.util.List + getMultiFieldValueClassUnderlyingTypeList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + int getMultiFieldValueClassUnderlyingTypeCount(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + java.util.List + getMultiFieldValueClassUnderlyingTypeOrBuilderList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getMultiFieldValueClassUnderlyingTypeOrBuilder( + int index); + + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + java.util.List getMultiFieldValueClassUnderlyingTypeIdList(); + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + int getMultiFieldValueClassUnderlyingTypeIdCount(); + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + int getMultiFieldValueClassUnderlyingTypeId(int index); /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -10726,22 +10763,59 @@ public final class DebugProtoBuf { input.popLimit(limit); break; } + case 176: { + if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00040000; + } + multiFieldValueClassUnderlyingName_.add(input.readInt32()); + break; + } case 178: { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder subBuilder = null; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - subBuilder = multiFieldValueClassRepresentation_.toBuilder(); + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00040000) == 0x00040000) && input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00040000; } - multiFieldValueClassRepresentation_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(multiFieldValueClassRepresentation_); - multiFieldValueClassRepresentation_ = subBuilder.buildPartial(); + while (input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingName_.add(input.readInt32()); } - bitField0_ |= 0x00000040; + input.popLimit(limit); + break; + } + case 186: { + if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00080000; + } + multiFieldValueClassUnderlyingType_.add(input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.PARSER, extensionRegistry)); + break; + } + case 192: { + if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00100000; + } + multiFieldValueClassUnderlyingTypeId_.add(input.readInt32()); + break; + } + case 194: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00100000) == 0x00100000) && input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00100000; + } + while (input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingTypeId_.add(input.readInt32()); + } + input.popLimit(limit); break; } case 242: { org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { subBuilder = typeTable_.toBuilder(); } typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.PARSER, extensionRegistry); @@ -10749,13 +10823,13 @@ public final class DebugProtoBuf { subBuilder.mergeFrom(typeTable_); typeTable_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; break; } case 248: { - if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + if (!((mutable_bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00100000; + mutable_bitField0_ |= 0x00400000; } versionRequirement_.add(input.readInt32()); break; @@ -10763,9 +10837,9 @@ public final class DebugProtoBuf { case 250: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00100000) == 0x00100000) && input.getBytesUntilLimit() > 0) { + if (!((mutable_bitField0_ & 0x00400000) == 0x00400000) && input.getBytesUntilLimit() > 0) { versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00100000; + mutable_bitField0_ |= 0x00400000; } while (input.getBytesUntilLimit() > 0) { versionRequirement_.add(input.readInt32()); @@ -10775,7 +10849,7 @@ public final class DebugProtoBuf { } case 258: { org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = versionRequirementTable_.toBuilder(); } versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); @@ -10783,7 +10857,7 @@ public final class DebugProtoBuf { subBuilder.mergeFrom(versionRequirementTable_); versionRequirementTable_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000080; break; } } @@ -10830,7 +10904,16 @@ public final class DebugProtoBuf { if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { contextReceiverTypeId_ = java.util.Collections.unmodifiableList(contextReceiverTypeId_); } + if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); + } + if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + } if (((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); + } + if (((mutable_bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); } this.unknownFields = unknownFields.build(); @@ -10999,1378 +11082,6 @@ public final class DebugProtoBuf { // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Class.Kind) } - public interface MultiFieldValueClassRepresentationOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - org.jetbrains.kotlin.protobuf.MessageOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - java.util.List - getPropertyList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - int getPropertyCount(); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - java.util.List - getPropertyOrBuilderList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder getPropertyOrBuilder( - int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation} - */ - public static final class MultiFieldValueClassRepresentation extends - org.jetbrains.kotlin.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - MultiFieldValueClassRepresentationOrBuilder { - // Use MultiFieldValueClassRepresentation.newBuilder() to construct. - private MultiFieldValueClassRepresentation(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private MultiFieldValueClassRepresentation(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final MultiFieldValueClassRepresentation defaultInstance; - public static MultiFieldValueClassRepresentation getDefaultInstance() { - return defaultInstance; - } - - public MultiFieldValueClassRepresentation getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final org.jetbrains.kotlin.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MultiFieldValueClassRepresentation( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields = - org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - property_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - property_.add(input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.PARSER, extensionRegistry)); - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - property_ = java.util.Collections.unmodifiableList(property_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor; - } - - protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder.class); - } - - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public MultiFieldValueClassRepresentation parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new MultiFieldValueClassRepresentation(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - public interface MultiFieldValueClassPropertyOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - org.jetbrains.kotlin.protobuf.MessageOrBuilder { - - /** - * required int32 name = 1; - */ - boolean hasName(); - /** - * required int32 name = 1; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - boolean hasType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getTypeOrBuilder(); - - /** - * optional int32 type_id = 3; - */ - boolean hasTypeId(); - /** - * optional int32 type_id = 3; - */ - int getTypeId(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty} - */ - public static final class MultiFieldValueClassProperty extends - org.jetbrains.kotlin.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - MultiFieldValueClassPropertyOrBuilder { - // Use MultiFieldValueClassProperty.newBuilder() to construct. - private MultiFieldValueClassProperty(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private MultiFieldValueClassProperty(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final MultiFieldValueClassProperty defaultInstance; - public static MultiFieldValueClassProperty getDefaultInstance() { - return defaultInstance; - } - - public MultiFieldValueClassProperty getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final org.jetbrains.kotlin.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MultiFieldValueClassProperty( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields = - org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } - case 18: { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = type_.toBuilder(); - } - type_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(type_); - type_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 24: { - bitField0_ |= 0x00000004; - typeId_ = input.readInt32(); - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor; - } - - protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder.class); - } - - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public MultiFieldValueClassProperty parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new MultiFieldValueClassProperty(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * required int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name = 1; - */ - public int getName() { - return name_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type type_; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getType() { - return type_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getTypeOrBuilder() { - return type_; - } - - public static final int TYPE_ID_FIELD_NUMBER = 3; - private int typeId_; - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - return typeId_; - } - - private void initFields() { - name_ = 0; - type_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance(); - typeId_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, type_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, typeId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, type_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(3, typeId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder { - public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor; - } - - protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder.class); - } - - // Construct using org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getTypeFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - if (typeBuilder_ == null) { - type_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance(); - } else { - typeBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - typeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor; - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty build() { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty buildPartial() { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty result = new org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - if (typeBuilder_ == null) { - result.type_ = type_; - } else { - result.type_ = typeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.typeId_ = typeId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) { - if (other instanceof org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) { - return mergeFrom((org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty other) { - if (other == org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasType()) { - mergeType(other.getType()); - } - if (other.hasTypeId()) { - setTypeId(other.getTypeId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int name_ ; - /** - * required int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name = 1; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 1; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; - onChanged(); - return this; - } - /** - * required int32 name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - onChanged(); - return this; - } - - private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance(); - private org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> typeBuilder_; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getType() { - if (typeBuilder_ == null) { - return type_; - } else { - return typeBuilder_.getMessage(); - } - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder setType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) { - if (typeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - type_ = value; - onChanged(); - } else { - typeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder setType( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) { - if (typeBuilder_ == null) { - type_ = builderForValue.build(); - onChanged(); - } else { - typeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder mergeType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) { - if (typeBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - type_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance()) { - type_ = - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); - } else { - type_ = value; - } - onChanged(); - } else { - typeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder clearType() { - if (typeBuilder_ == null) { - type_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance(); - onChanged(); - } else { - typeBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder getTypeBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getTypeFieldBuilder().getBuilder(); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getTypeOrBuilder() { - if (typeBuilder_ != null) { - return typeBuilder_.getMessageOrBuilder(); - } else { - return type_; - } - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - private org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> - getTypeFieldBuilder() { - if (typeBuilder_ == null) { - typeBuilder_ = new org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>( - getType(), - getParentForChildren(), - isClean()); - type_ = null; - } - return typeBuilder_; - } - - private int typeId_ ; - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - return typeId_; - } - /** - * optional int32 type_id = 3; - */ - public Builder setTypeId(int value) { - bitField0_ |= 0x00000004; - typeId_ = value; - onChanged(); - return this; - } - /** - * optional int32 type_id = 3; - */ - public Builder clearTypeId() { - bitField0_ = (bitField0_ & ~0x00000004); - typeId_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - } - - static { - defaultInstance = new MultiFieldValueClassProperty(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - } - - public static final int PROPERTY_FIELD_NUMBER = 1; - private java.util.List property_; - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List getPropertyList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List - getPropertyOrBuilderList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder getPropertyOrBuilder( - int index) { - return property_.get(index); - } - - private void initFields() { - property_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < property_.size(); i++) { - output.writeMessage(1, property_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < property_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, property_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder { - public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor; - } - - protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder.class); - } - - // Construct using org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPropertyFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (propertyBuilder_ == null) { - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - propertyBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor; - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation build() { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation buildPartial() { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation result = new org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation(this); - int from_bitField0_ = bitField0_; - if (propertyBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - property_ = java.util.Collections.unmodifiableList(property_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.property_ = property_; - } else { - result.property_ = propertyBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) { - if (other instanceof org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation) { - return mergeFrom((org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation other) { - if (other == org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance()) return this; - if (propertyBuilder_ == null) { - if (!other.property_.isEmpty()) { - if (property_.isEmpty()) { - property_ = other.property_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePropertyIsMutable(); - property_.addAll(other.property_); - } - onChanged(); - } - } else { - if (!other.property_.isEmpty()) { - if (propertyBuilder_.isEmpty()) { - propertyBuilder_.dispose(); - propertyBuilder_ = null; - property_ = other.property_; - bitField0_ = (bitField0_ & ~0x00000001); - propertyBuilder_ = - org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropertyFieldBuilder() : null; - } else { - propertyBuilder_.addAllMessages(other.property_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List property_ = - java.util.Collections.emptyList(); - private void ensurePropertyIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - property_ = new java.util.ArrayList(property_); - bitField0_ |= 0x00000001; - } - } - - private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder> propertyBuilder_; - - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List getPropertyList() { - if (propertyBuilder_ == null) { - return java.util.Collections.unmodifiableList(property_); - } else { - return propertyBuilder_.getMessageList(); - } - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public int getPropertyCount() { - if (propertyBuilder_ == null) { - return property_.size(); - } else { - return propertyBuilder_.getCount(); - } - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index) { - if (propertyBuilder_ == null) { - return property_.get(index); - } else { - return propertyBuilder_.getMessage(index); - } - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (propertyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.set(index, value); - onChanged(); - } else { - propertyBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - if (propertyBuilder_ == null) { - ensurePropertyIsMutable(); - property_.set(index, builderForValue.build()); - onChanged(); - } else { - propertyBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (propertyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(value); - onChanged(); - } else { - propertyBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (propertyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(index, value); - onChanged(); - } else { - propertyBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - if (propertyBuilder_ == null) { - ensurePropertyIsMutable(); - property_.add(builderForValue.build()); - onChanged(); - } else { - propertyBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - if (propertyBuilder_ == null) { - ensurePropertyIsMutable(); - property_.add(index, builderForValue.build()); - onChanged(); - } else { - propertyBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addAllProperty( - java.lang.Iterable values) { - if (propertyBuilder_ == null) { - ensurePropertyIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, property_); - onChanged(); - } else { - propertyBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder clearProperty() { - if (propertyBuilder_ == null) { - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - propertyBuilder_.clear(); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder removeProperty(int index) { - if (propertyBuilder_ == null) { - ensurePropertyIsMutable(); - property_.remove(index); - onChanged(); - } else { - propertyBuilder_.remove(index); - } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder getPropertyBuilder( - int index) { - return getPropertyFieldBuilder().getBuilder(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder getPropertyOrBuilder( - int index) { - if (propertyBuilder_ == null) { - return property_.get(index); } else { - return propertyBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List - getPropertyOrBuilderList() { - if (propertyBuilder_ != null) { - return propertyBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(property_); - } - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder addPropertyBuilder() { - return getPropertyFieldBuilder().addBuilder( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance()); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder addPropertyBuilder( - int index) { - return getPropertyFieldBuilder().addBuilder( - index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance()); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List - getPropertyBuilderList() { - return getPropertyFieldBuilder().getBuilderList(); - } - private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder> - getPropertyFieldBuilder() { - if (propertyBuilder_ == null) { - propertyBuilder_ = new org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder>( - property_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - property_ = null; - } - return propertyBuilder_; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - } - - static { - defaultInstance = new MultiFieldValueClassRepresentation(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - } - private int bitField0_; public static final int FLAGS_FIELD_NUMBER = 1; private int flags_; @@ -12866,26 +11577,86 @@ public final class DebugProtoBuf { return inlineClassUnderlyingTypeId_; } - public static final int MULTI_FIELD_VALUE_CLASS_REPRESENTATION_FIELD_NUMBER = 22; - private org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation multiFieldValueClassRepresentation_; + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_FIELD_NUMBER = 22; + private java.util.List multiFieldValueClassUnderlyingName_; /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public boolean hasMultiFieldValueClassRepresentation() { - return ((bitField0_ & 0x00000040) == 0x00000040); + public java.util.List + getMultiFieldValueClassUnderlyingNameList() { + return multiFieldValueClassUnderlyingName_; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - return multiFieldValueClassRepresentation_; + public int getMultiFieldValueClassUnderlyingNameCount() { + return multiFieldValueClassUnderlyingName_.size(); } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder getMultiFieldValueClassRepresentationOrBuilder() { - return multiFieldValueClassRepresentation_; + public int getMultiFieldValueClassUnderlyingName(int index) { + return multiFieldValueClassUnderlyingName_.get(index); } + private int multiFieldValueClassUnderlyingNameMemoizedSerializedSize = -1; + + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 23; + private java.util.List multiFieldValueClassUnderlyingType_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List getMultiFieldValueClassUnderlyingTypeList() { + return multiFieldValueClassUnderlyingType_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeOrBuilderList() { + return multiFieldValueClassUnderlyingType_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public int getMultiFieldValueClassUnderlyingTypeCount() { + return multiFieldValueClassUnderlyingType_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index) { + return multiFieldValueClassUnderlyingType_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getMultiFieldValueClassUnderlyingTypeOrBuilder( + int index) { + return multiFieldValueClassUnderlyingType_.get(index); + } + + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 24; + private java.util.List multiFieldValueClassUnderlyingTypeId_; + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeIdList() { + return multiFieldValueClassUnderlyingTypeId_; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeIdCount() { + return multiFieldValueClassUnderlyingTypeId_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeId(int index) { + return multiFieldValueClassUnderlyingTypeId_.get(index); + } + private int multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize = -1; public static final int TYPE_TABLE_FIELD_NUMBER = 30; private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_; @@ -12893,7 +11664,7 @@ public final class DebugProtoBuf { * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public boolean hasTypeTable() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -12948,7 +11719,7 @@ public final class DebugProtoBuf { * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000080) == 0x00000080); } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; @@ -12982,7 +11753,9 @@ public final class DebugProtoBuf { inlineClassUnderlyingPropertyName_ = 0; inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance(); inlineClassUnderlyingTypeId_ = 0; - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance(); versionRequirement_ = java.util.Collections.emptyList(); versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance(); @@ -13051,8 +11824,8 @@ public final class DebugProtoBuf { return false; } } - if (hasMultiFieldValueClassRepresentation()) { - if (!getMultiFieldValueClassRepresentation().isInitialized()) { + for (int i = 0; i < getMultiFieldValueClassUnderlyingTypeCount(); i++) { + if (!getMultiFieldValueClassUnderlyingType(i).isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -13147,16 +11920,30 @@ public final class DebugProtoBuf { for (int i = 0; i < contextReceiverTypeId_.size(); i++) { output.writeInt32NoTag(contextReceiverTypeId_.get(i)); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeMessage(22, multiFieldValueClassRepresentation_); + if (getMultiFieldValueClassUnderlyingNameList().size() > 0) { + output.writeRawVarint32(178); + output.writeRawVarint32(multiFieldValueClassUnderlyingNameMemoizedSerializedSize); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + for (int i = 0; i < multiFieldValueClassUnderlyingName_.size(); i++) { + output.writeInt32NoTag(multiFieldValueClassUnderlyingName_.get(i)); + } + for (int i = 0; i < multiFieldValueClassUnderlyingType_.size(); i++) { + output.writeMessage(23, multiFieldValueClassUnderlyingType_.get(i)); + } + if (getMultiFieldValueClassUnderlyingTypeIdList().size() > 0) { + output.writeRawVarint32(194); + output.writeRawVarint32(multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize); + } + for (int i = 0; i < multiFieldValueClassUnderlyingTypeId_.size(); i++) { + output.writeInt32NoTag(multiFieldValueClassUnderlyingTypeId_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeMessage(30, typeTable_); } for (int i = 0; i < versionRequirement_.size(); i++) { output.writeInt32(31, versionRequirement_.get(i)); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeMessage(32, versionRequirementTable_); } extensionWriter.writeUntil(19000, output); @@ -13281,11 +12068,39 @@ public final class DebugProtoBuf { } contextReceiverTypeIdMemoizedSerializedSize = dataSize; } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(22, multiFieldValueClassRepresentation_); + { + int dataSize = 0; + for (int i = 0; i < multiFieldValueClassUnderlyingName_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(multiFieldValueClassUnderlyingName_.get(i)); + } + size += dataSize; + if (!getMultiFieldValueClassUnderlyingNameList().isEmpty()) { + size += 2; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + multiFieldValueClassUnderlyingNameMemoizedSerializedSize = dataSize; } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + for (int i = 0; i < multiFieldValueClassUnderlyingType_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(23, multiFieldValueClassUnderlyingType_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < multiFieldValueClassUnderlyingTypeId_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(multiFieldValueClassUnderlyingTypeId_.get(i)); + } + size += dataSize; + if (!getMultiFieldValueClassUnderlyingTypeIdList().isEmpty()) { + size += 2; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(30, typeTable_); } @@ -13298,7 +12113,7 @@ public final class DebugProtoBuf { size += dataSize; size += 2 * getVersionRequirementList().size(); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(32, versionRequirementTable_); } @@ -13422,7 +12237,7 @@ public final class DebugProtoBuf { getTypeAliasFieldBuilder(); getEnumEntryFieldBuilder(); getInlineClassUnderlyingTypeFieldBuilder(); - getMultiFieldValueClassRepresentationFieldBuilder(); + getMultiFieldValueClassUnderlyingTypeFieldBuilder(); getTypeTableFieldBuilder(); getVersionRequirementTableFieldBuilder(); } @@ -13505,26 +12320,30 @@ public final class DebugProtoBuf { bitField0_ = (bitField0_ & ~0x00010000); inlineClassUnderlyingTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00020000); - if (multiFieldValueClassRepresentationBuilder_ == null) { - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); - } else { - multiFieldValueClassRepresentationBuilder_.clear(); - } + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00040000); + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00080000); + } else { + multiFieldValueClassUnderlyingTypeBuilder_.clear(); + } + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00100000); if (typeTableBuilder_ == null) { typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance(); } else { typeTableBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); if (versionRequirementTableBuilder_ == null) { versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance(); } else { versionRequirementTableBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00800000); return this; } @@ -13673,29 +12492,40 @@ public final class DebugProtoBuf { to_bitField0_ |= 0x00000020; } result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_; - if (((from_bitField0_ & 0x00040000) == 0x00040000)) { - to_bitField0_ |= 0x00000040; + if (((bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); + bitField0_ = (bitField0_ & ~0x00040000); } - if (multiFieldValueClassRepresentationBuilder_ == null) { - result.multiFieldValueClassRepresentation_ = multiFieldValueClassRepresentation_; + result.multiFieldValueClassUnderlyingName_ = multiFieldValueClassUnderlyingName_; + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + if (((bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + bitField0_ = (bitField0_ & ~0x00080000); + } + result.multiFieldValueClassUnderlyingType_ = multiFieldValueClassUnderlyingType_; } else { - result.multiFieldValueClassRepresentation_ = multiFieldValueClassRepresentationBuilder_.build(); + result.multiFieldValueClassUnderlyingType_ = multiFieldValueClassUnderlyingTypeBuilder_.build(); } - if (((from_bitField0_ & 0x00080000) == 0x00080000)) { - to_bitField0_ |= 0x00000080; + if (((bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); + bitField0_ = (bitField0_ & ~0x00100000); + } + result.multiFieldValueClassUnderlyingTypeId_ = multiFieldValueClassUnderlyingTypeId_; + if (((from_bitField0_ & 0x00200000) == 0x00200000)) { + to_bitField0_ |= 0x00000040; } if (typeTableBuilder_ == null) { result.typeTable_ = typeTable_; } else { result.typeTable_ = typeTableBuilder_.build(); } - if (((bitField0_ & 0x00100000) == 0x00100000)) { + if (((bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); } result.versionRequirement_ = versionRequirement_; - if (((from_bitField0_ & 0x00200000) == 0x00200000)) { - to_bitField0_ |= 0x00000100; + if (((from_bitField0_ & 0x00800000) == 0x00800000)) { + to_bitField0_ |= 0x00000080; } if (versionRequirementTableBuilder_ == null) { result.versionRequirementTable_ = versionRequirementTable_; @@ -13984,8 +12814,51 @@ public final class DebugProtoBuf { if (other.hasInlineClassUnderlyingTypeId()) { setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId()); } - if (other.hasMultiFieldValueClassRepresentation()) { - mergeMultiFieldValueClassRepresentation(other.getMultiFieldValueClassRepresentation()); + if (!other.multiFieldValueClassUnderlyingName_.isEmpty()) { + if (multiFieldValueClassUnderlyingName_.isEmpty()) { + multiFieldValueClassUnderlyingName_ = other.multiFieldValueClassUnderlyingName_; + bitField0_ = (bitField0_ & ~0x00040000); + } else { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.addAll(other.multiFieldValueClassUnderlyingName_); + } + onChanged(); + } + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + if (!other.multiFieldValueClassUnderlyingType_.isEmpty()) { + if (multiFieldValueClassUnderlyingType_.isEmpty()) { + multiFieldValueClassUnderlyingType_ = other.multiFieldValueClassUnderlyingType_; + bitField0_ = (bitField0_ & ~0x00080000); + } else { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.addAll(other.multiFieldValueClassUnderlyingType_); + } + onChanged(); + } + } else { + if (!other.multiFieldValueClassUnderlyingType_.isEmpty()) { + if (multiFieldValueClassUnderlyingTypeBuilder_.isEmpty()) { + multiFieldValueClassUnderlyingTypeBuilder_.dispose(); + multiFieldValueClassUnderlyingTypeBuilder_ = null; + multiFieldValueClassUnderlyingType_ = other.multiFieldValueClassUnderlyingType_; + bitField0_ = (bitField0_ & ~0x00080000); + multiFieldValueClassUnderlyingTypeBuilder_ = + org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMultiFieldValueClassUnderlyingTypeFieldBuilder() : null; + } else { + multiFieldValueClassUnderlyingTypeBuilder_.addAllMessages(other.multiFieldValueClassUnderlyingType_); + } + } + } + if (!other.multiFieldValueClassUnderlyingTypeId_.isEmpty()) { + if (multiFieldValueClassUnderlyingTypeId_.isEmpty()) { + multiFieldValueClassUnderlyingTypeId_ = other.multiFieldValueClassUnderlyingTypeId_; + bitField0_ = (bitField0_ & ~0x00100000); + } else { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.addAll(other.multiFieldValueClassUnderlyingTypeId_); + } + onChanged(); } if (other.hasTypeTable()) { mergeTypeTable(other.getTypeTable()); @@ -13993,7 +12866,7 @@ public final class DebugProtoBuf { if (!other.versionRequirement_.isEmpty()) { if (versionRequirement_.isEmpty()) { versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); } else { ensureVersionRequirementIsMutable(); versionRequirement_.addAll(other.versionRequirement_); @@ -14067,8 +12940,8 @@ public final class DebugProtoBuf { return false; } } - if (hasMultiFieldValueClassRepresentation()) { - if (!getMultiFieldValueClassRepresentation().isInitialized()) { + for (int i = 0; i < getMultiFieldValueClassUnderlyingTypeCount(); i++) { + if (!getMultiFieldValueClassUnderlyingType(i).isInitialized()) { return false; } @@ -16617,120 +15490,376 @@ public final class DebugProtoBuf { return this; } - private org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); - private org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder> multiFieldValueClassRepresentationBuilder_; - /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; - */ - public boolean hasMultiFieldValueClassRepresentation() { - return ((bitField0_ & 0x00040000) == 0x00040000); + private java.util.List multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingNameIsMutable() { + if (!((bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(multiFieldValueClassUnderlyingName_); + bitField0_ |= 0x00040000; + } } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - if (multiFieldValueClassRepresentationBuilder_ == null) { - return multiFieldValueClassRepresentation_; + public java.util.List + getMultiFieldValueClassUnderlyingNameList() { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingNameCount() { + return multiFieldValueClassUnderlyingName_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingName(int index) { + return multiFieldValueClassUnderlyingName_.get(index); + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder setMultiFieldValueClassUnderlyingName( + int index, int value) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.set(index, value); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder addMultiFieldValueClassUnderlyingName(int value) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.add(value); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder addAllMultiFieldValueClassUnderlyingName( + java.lang.Iterable values) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingName_); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder clearMultiFieldValueClassUnderlyingName() { + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00040000); + onChanged(); + return this; + } + + private java.util.List multiFieldValueClassUnderlyingType_ = + java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingTypeIsMutable() { + if (!((bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = new java.util.ArrayList(multiFieldValueClassUnderlyingType_); + bitField0_ |= 0x00080000; + } + } + + private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> multiFieldValueClassUnderlyingTypeBuilder_; + + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List getMultiFieldValueClassUnderlyingTypeList() { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); } else { - return multiFieldValueClassRepresentationBuilder_.getMessage(); + return multiFieldValueClassUnderlyingTypeBuilder_.getMessageList(); } } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder setMultiFieldValueClassRepresentation(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation value) { - if (multiFieldValueClassRepresentationBuilder_ == null) { + public int getMultiFieldValueClassUnderlyingTypeCount() { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + return multiFieldValueClassUnderlyingType_.size(); + } else { + return multiFieldValueClassUnderlyingTypeBuilder_.getCount(); + } + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + return multiFieldValueClassUnderlyingType_.get(index); + } else { + return multiFieldValueClassUnderlyingTypeBuilder_.getMessage(index); + } + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder setMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - multiFieldValueClassRepresentation_ = value; + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.set(index, value); onChanged(); } else { - multiFieldValueClassRepresentationBuilder_.setMessage(value); + multiFieldValueClassUnderlyingTypeBuilder_.setMessage(index, value); } - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder setMultiFieldValueClassRepresentation( - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder builderForValue) { - if (multiFieldValueClassRepresentationBuilder_ == null) { - multiFieldValueClassRepresentation_ = builderForValue.build(); + public Builder setMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.set(index, builderForValue.build()); onChanged(); } else { - multiFieldValueClassRepresentationBuilder_.setMessage(builderForValue.build()); + multiFieldValueClassUnderlyingTypeBuilder_.setMessage(index, builderForValue.build()); } - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder mergeMultiFieldValueClassRepresentation(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation value) { - if (multiFieldValueClassRepresentationBuilder_ == null) { - if (((bitField0_ & 0x00040000) == 0x00040000) && - multiFieldValueClassRepresentation_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance()) { - multiFieldValueClassRepresentation_ = - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.newBuilder(multiFieldValueClassRepresentation_).mergeFrom(value).buildPartial(); - } else { - multiFieldValueClassRepresentation_ = value; + public Builder addMultiFieldValueClassUnderlyingType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(value); onChanged(); } else { - multiFieldValueClassRepresentationBuilder_.mergeFrom(value); + multiFieldValueClassUnderlyingTypeBuilder_.addMessage(value); } - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder clearMultiFieldValueClassRepresentation() { - if (multiFieldValueClassRepresentationBuilder_ == null) { - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); + public Builder addMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(index, value); onChanged(); } else { - multiFieldValueClassRepresentationBuilder_.clear(); + multiFieldValueClassUnderlyingTypeBuilder_.addMessage(index, value); } - bitField0_ = (bitField0_ & ~0x00040000); return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder getMultiFieldValueClassRepresentationBuilder() { - bitField0_ |= 0x00040000; - onChanged(); - return getMultiFieldValueClassRepresentationFieldBuilder().getBuilder(); + public Builder addMultiFieldValueClassUnderlyingType( + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(builderForValue.build()); + onChanged(); + } else { + multiFieldValueClassUnderlyingTypeBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder getMultiFieldValueClassRepresentationOrBuilder() { - if (multiFieldValueClassRepresentationBuilder_ != null) { - return multiFieldValueClassRepresentationBuilder_.getMessageOrBuilder(); + public Builder addMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(index, builderForValue.build()); + onChanged(); } else { - return multiFieldValueClassRepresentation_; + multiFieldValueClassUnderlyingTypeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder addAllMultiFieldValueClassUnderlyingType( + java.lang.Iterable values) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingType_); + onChanged(); + } else { + multiFieldValueClassUnderlyingTypeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder clearMultiFieldValueClassUnderlyingType() { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + } else { + multiFieldValueClassUnderlyingTypeBuilder_.clear(); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder removeMultiFieldValueClassUnderlyingType(int index) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.remove(index); + onChanged(); + } else { + multiFieldValueClassUnderlyingTypeBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder getMultiFieldValueClassUnderlyingTypeBuilder( + int index) { + return getMultiFieldValueClassUnderlyingTypeFieldBuilder().getBuilder(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getMultiFieldValueClassUnderlyingTypeOrBuilder( + int index) { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + return multiFieldValueClassUnderlyingType_.get(index); } else { + return multiFieldValueClassUnderlyingTypeBuilder_.getMessageOrBuilder(index); } } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - private org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder> - getMultiFieldValueClassRepresentationFieldBuilder() { - if (multiFieldValueClassRepresentationBuilder_ == null) { - multiFieldValueClassRepresentationBuilder_ = new org.jetbrains.kotlin.protobuf.SingleFieldBuilder< - org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentation.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder>( - getMultiFieldValueClassRepresentation(), + public java.util.List + getMultiFieldValueClassUnderlyingTypeOrBuilderList() { + if (multiFieldValueClassUnderlyingTypeBuilder_ != null) { + return multiFieldValueClassUnderlyingTypeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + } + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder addMultiFieldValueClassUnderlyingTypeBuilder() { + return getMultiFieldValueClassUnderlyingTypeFieldBuilder().addBuilder( + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder addMultiFieldValueClassUnderlyingTypeBuilder( + int index) { + return getMultiFieldValueClassUnderlyingTypeFieldBuilder().addBuilder( + index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeBuilderList() { + return getMultiFieldValueClassUnderlyingTypeFieldBuilder().getBuilderList(); + } + private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> + getMultiFieldValueClassUnderlyingTypeFieldBuilder() { + if (multiFieldValueClassUnderlyingTypeBuilder_ == null) { + multiFieldValueClassUnderlyingTypeBuilder_ = new org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>( + multiFieldValueClassUnderlyingType_, + ((bitField0_ & 0x00080000) == 0x00080000), getParentForChildren(), isClean()); - multiFieldValueClassRepresentation_ = null; + multiFieldValueClassUnderlyingType_ = null; } - return multiFieldValueClassRepresentationBuilder_; + return multiFieldValueClassUnderlyingTypeBuilder_; + } + + private java.util.List multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingTypeIdIsMutable() { + if (!((bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(multiFieldValueClassUnderlyingTypeId_); + bitField0_ |= 0x00100000; + } + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeIdList() { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeIdCount() { + return multiFieldValueClassUnderlyingTypeId_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeId(int index) { + return multiFieldValueClassUnderlyingTypeId_.get(index); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder setMultiFieldValueClassUnderlyingTypeId( + int index, int value) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.set(index, value); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder addMultiFieldValueClassUnderlyingTypeId(int value) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.add(value); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder addAllMultiFieldValueClassUnderlyingTypeId( + java.lang.Iterable values) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingTypeId_); + onChanged(); + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder clearMultiFieldValueClassUnderlyingTypeId() { + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + return this; } private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance(); @@ -16740,7 +15869,7 @@ public final class DebugProtoBuf { * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public boolean hasTypeTable() { - return ((bitField0_ & 0x00080000) == 0x00080000); + return ((bitField0_ & 0x00200000) == 0x00200000); } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -16765,7 +15894,7 @@ public final class DebugProtoBuf { } else { typeTableBuilder_.setMessage(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** @@ -16779,7 +15908,7 @@ public final class DebugProtoBuf { } else { typeTableBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** @@ -16787,7 +15916,7 @@ public final class DebugProtoBuf { */ public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable value) { if (typeTableBuilder_ == null) { - if (((bitField0_ & 0x00080000) == 0x00080000) && + if (((bitField0_ & 0x00200000) == 0x00200000) && typeTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); @@ -16798,7 +15927,7 @@ public final class DebugProtoBuf { } else { typeTableBuilder_.mergeFrom(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** @@ -16811,14 +15940,14 @@ public final class DebugProtoBuf { } else { typeTableBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); return this; } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder getTypeTableBuilder() { - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; onChanged(); return getTypeTableFieldBuilder().getBuilder(); } @@ -16851,9 +15980,9 @@ public final class DebugProtoBuf { private java.util.List versionRequirement_ = java.util.Collections.emptyList(); private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00100000) == 0x00100000)) { + if (!((bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00400000; } } /** @@ -16938,7 +16067,7 @@ public final class DebugProtoBuf { */ public Builder clearVersionRequirement() { versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); onChanged(); return this; } @@ -16950,7 +16079,7 @@ public final class DebugProtoBuf { * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00200000) == 0x00200000); + return ((bitField0_ & 0x00800000) == 0x00800000); } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; @@ -16975,7 +16104,7 @@ public final class DebugProtoBuf { } else { versionRequirementTableBuilder_.setMessage(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** @@ -16989,7 +16118,7 @@ public final class DebugProtoBuf { } else { versionRequirementTableBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** @@ -16997,7 +16126,7 @@ public final class DebugProtoBuf { */ public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable value) { if (versionRequirementTableBuilder_ == null) { - if (((bitField0_ & 0x00200000) == 0x00200000) && + if (((bitField0_ & 0x00800000) == 0x00800000) && versionRequirementTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance()) { versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); @@ -17008,7 +16137,7 @@ public final class DebugProtoBuf { } else { versionRequirementTableBuilder_.mergeFrom(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** @@ -17021,14 +16150,14 @@ public final class DebugProtoBuf { } else { versionRequirementTableBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00800000); return this; } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder getVersionRequirementTableBuilder() { - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; onChanged(); return getVersionRequirementTableFieldBuilder().getBuilder(); } @@ -37794,16 +36923,6 @@ public final class DebugProtoBuf { private static org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_jetbrains_kotlin_metadata_Class_fieldAccessorTable; - private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor; - private static - org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_fieldAccessorTable; - private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor; - private static - org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_fieldAccessorTable; private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor internal_static_org_jetbrains_kotlin_metadata_Package_descriptor; private static @@ -37941,7 +37060,7 @@ public final class DebugProtoBuf { "Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#.org" + ".jetbrains.kotlin.metadata.Type\022\036\n\016upper" + "_bound_id\030\006 \003(\005B\006\020\001\240\265\030\001\"$\n\010Variance\022\006\n\002I" + - "N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\317\014\n\005Class\022\020" + + "N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\220\013\n\005Class\022\020" + "\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022", "#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016" + "type_parameter\030\005 \003(\0132,.org.jetbrains.kot" + @@ -37964,138 +37083,133 @@ public final class DebugProtoBuf { "y_name\030\021 \001(\005B\004\210\265\030\001\022I\n\034inline_class_under" + "lying_type\030\022 \001(\0132#.org.jetbrains.kotlin.", "metadata.Type\022-\n\037inline_class_underlying" + - "_type_id\030\023 \001(\005B\004\240\265\030\001\022w\n&multi_field_valu" + - "e_class_representation\030\026 \001(\0132G.org.jetbr" + - "ains.kotlin.metadata.Class.MultiFieldVal" + - "ueClassRepresentation\022<\n\ntype_table\030\036 \001(" + - "\0132(.org.jetbrains.kotlin.metadata.TypeTa" + - "ble\022\033\n\023version_requirement\030\037 \003(\005\022Y\n\031vers" + - "ion_requirement_table\030 \001(\01326.org.jetbra" + - "ins.kotlin.metadata.VersionRequirementTa" + - "ble\032\216\002\n\"MultiFieldValueClassRepresentati", - "on\022v\n\010property\030\001 \003(\0132d.org.jetbrains.kot" + - "lin.metadata.Class.MultiFieldValueClassR" + - "epresentation.MultiFieldValueClassProper" + - "ty\032p\n\034MultiFieldValueClassProperty\022\014\n\004na" + - "me\030\001 \002(\005\0221\n\004type\030\002 \001(\0132#.org.jetbrains.k" + - "otlin.metadata.Type\022\017\n\007type_id\030\003 \001(\005\"x\n\004" + - "Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_C" + - "LASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLA" + - "SS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*\006" + - "\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'.o", - "rg.jetbrains.kotlin.metadata.Function\0229\n" + - "\010property\030\004 \003(\0132\'.org.jetbrains.kotlin.m" + - "etadata.Property\022<\n\ntype_alias\030\005 \003(\0132(.o" + - "rg.jetbrains.kotlin.metadata.TypeAlias\022<" + - "\n\ntype_table\030\036 \001(\0132(.org.jetbrains.kotli" + - "n.metadata.TypeTable\022Y\n\031version_requirem" + - "ent_table\030 \001(\01326.org.jetbrains.kotlin.m" + - "etadata.VersionRequirementTable*\005\010d\020\310\001\"`" + - "\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrain" + - "s.kotlin.metadata.Type\022\032\n\016first_nullable", - "\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructor\022\020\n\005flag" + - "s\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002 \003(\0132-.or" + - "g.jetbrains.kotlin.metadata.ValueParamet" + - "er\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224\001\"" + - "\224\005\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_fl" + - "ags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013retu" + - "rn_type\030\003 \001(\0132#.org.jetbrains.kotlin.met" + - "adata.Type\022\034\n\016return_type_id\030\007 \001(\005B\004\240\265\030\001" + - "\022D\n\016type_parameter\030\004 \003(\0132,.org.jetbrains" + - ".kotlin.metadata.TypeParameter\022:\n\rreceiv", - "er_type\030\005 \001(\0132#.org.jetbrains.kotlin.met" + - "adata.Type\022\036\n\020receiver_type_id\030\010 \001(\005B\004\240\265" + - "\030\001\022B\n\025context_receiver_type\030\n \003(\0132#.org." + - "jetbrains.kotlin.metadata.Type\022(\n\030contex" + - "t_receiver_type_id\030\013 \003(\005B\006\020\001\240\265\030\001\022F\n\017valu" + - "e_parameter\030\006 \003(\0132-.org.jetbrains.kotlin" + - ".metadata.ValueParameter\022<\n\ntype_table\030\036" + - " \001(\0132(.org.jetbrains.kotlin.metadata.Typ" + - "eTable\022\033\n\023version_requirement\030\037 \003(\005\0229\n\010c" + - "ontract\030 \001(\0132\'.org.jetbrains.kotlin.met", - "adata.Contract*\006\010d\020\270\224\001\"\323\004\n\010Property\022\022\n\005f" + - "lags\030\013 \001(\005:\003518\022\027\n\told_flags\030\001 \001(\005:\0042054" + - "\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013return_type\030\003 \001(" + - "\0132#.org.jetbrains.kotlin.metadata.Type\022\034" + - "\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022D\n\016type_par" + - "ameter\030\004 \003(\0132,.org.jetbrains.kotlin.meta" + - "data.TypeParameter\022:\n\rreceiver_type\030\005 \001(" + - "\0132#.org.jetbrains.kotlin.metadata.Type\022\036" + - "\n\020receiver_type_id\030\n \001(\005B\004\240\265\030\001\022B\n\025contex" + - "t_receiver_type\030\014 \003(\0132#.org.jetbrains.ko", - "tlin.metadata.Type\022(\n\030context_receiver_t" + - "ype_id\030\r \003(\005B\006\020\001\240\265\030\001\022M\n\026setter_value_par" + - "ameter\030\006 \001(\0132-.org.jetbrains.kotlin.meta" + - "data.ValueParameter\022\024\n\014getter_flags\030\007 \001(" + - "\005\022\024\n\014setter_flags\030\010 \001(\005\022\033\n\023version_requi" + - "rement\030\037 \003(\005*\006\010d\020\270\224\001\"\357\001\n\016ValueParameter\022" + - "\020\n\005flags\030\001 \001(\005:\0010\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n" + - "\004type\030\003 \001(\0132#.org.jetbrains.kotlin.metad" + - "ata.Type\022\025\n\007type_id\030\005 \001(\005B\004\240\265\030\001\022@\n\023varar" + - "g_element_type\030\004 \001(\0132#.org.jetbrains.kot", - "lin.metadata.Type\022$\n\026vararg_element_type" + - "_id\030\006 \001(\005B\004\240\265\030\001*\005\010d\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005" + - "flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022D\n\016ty" + - "pe_parameter\030\003 \003(\0132,.org.jetbrains.kotli" + - "n.metadata.TypeParameter\022<\n\017underlying_t" + - "ype\030\004 \001(\0132#.org.jetbrains.kotlin.metadat" + - "a.Type\022 \n\022underlying_type_id\030\005 \001(\005B\004\240\265\030\001" + - "\022:\n\rexpanded_type\030\006 \001(\0132#.org.jetbrains." + - "kotlin.metadata.Type\022\036\n\020expanded_type_id" + - "\030\007 \001(\005B\004\240\265\030\001\022=\n\nannotation\030\010 \003(\0132).org.j", - "etbrains.kotlin.metadata.Annotation\022\033\n\023v" + - "ersion_requirement\030\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumE" + - "ntry\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022Vers" + - "ionRequirement\022\017\n\007version\030\001 \001(\005\022\024\n\014versi" + - "on_full\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.org.jetbr" + - "ains.kotlin.metadata.VersionRequirement." + - "Level:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007mess" + - "age\030\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\0162=." + + "_type_id\030\023 \001(\005B\004\240\265\030\001\0227\n\'multi_field_valu" + + "e_class_underlying_name\030\026 \003(\005B\006\020\001\210\265\030\001\022T\n" + + "\'multi_field_value_class_underlying_type" + + "\030\027 \003(\0132#.org.jetbrains.kotlin.metadata.T" + + "ype\022:\n*multi_field_value_class_underlyin" + + "g_type_id\030\030 \003(\005B\006\020\001\240\265\030\001\022<\n\ntype_table\030\036 " + + "\001(\0132(.org.jetbrains.kotlin.metadata.Type" + + "Table\022\033\n\023version_requirement\030\037 \003(\005\022Y\n\031ve" + + "rsion_requirement_table\030 \001(\01326.org.jetb", + "rains.kotlin.metadata.VersionRequirement" + + "Table\"x\n\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022" + + "\016\n\nENUM_CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOT" + + "ATION_CLASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_O" + + "BJECT\020\006*\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030" + + "\003 \003(\0132\'.org.jetbrains.kotlin.metadata.Fu" + + "nction\0229\n\010property\030\004 \003(\0132\'.org.jetbrains" + + ".kotlin.metadata.Property\022<\n\ntype_alias\030" + + "\005 \003(\0132(.org.jetbrains.kotlin.metadata.Ty" + + "peAlias\022<\n\ntype_table\030\036 \001(\0132(.org.jetbra", + "ins.kotlin.metadata.TypeTable\022Y\n\031version" + + "_requirement_table\030 \001(\01326.org.jetbrains" + + ".kotlin.metadata.VersionRequirementTable" + + "*\005\010d\020\310\001\"`\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org" + + ".jetbrains.kotlin.metadata.Type\022\032\n\016first" + + "_nullable\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructo" + + "r\022\020\n\005flags\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002" + + " \003(\0132-.org.jetbrains.kotlin.metadata.Val" + + "ueParameter\022\033\n\023version_requirement\030\037 \003(\005" + + "*\006\010d\020\270\224\001\"\224\005\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022", + "\024\n\told_flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030" + + "\001\0228\n\013return_type\030\003 \001(\0132#.org.jetbrains.k" + + "otlin.metadata.Type\022\034\n\016return_type_id\030\007 " + + "\001(\005B\004\240\265\030\001\022D\n\016type_parameter\030\004 \003(\0132,.org." + + "jetbrains.kotlin.metadata.TypeParameter\022" + + ":\n\rreceiver_type\030\005 \001(\0132#.org.jetbrains.k" + + "otlin.metadata.Type\022\036\n\020receiver_type_id\030" + + "\010 \001(\005B\004\240\265\030\001\022B\n\025context_receiver_type\030\n \003" + + "(\0132#.org.jetbrains.kotlin.metadata.Type\022" + + "(\n\030context_receiver_type_id\030\013 \003(\005B\006\020\001\240\265\030", + "\001\022F\n\017value_parameter\030\006 \003(\0132-.org.jetbrai" + + "ns.kotlin.metadata.ValueParameter\022<\n\ntyp" + + "e_table\030\036 \001(\0132(.org.jetbrains.kotlin.met" + + "adata.TypeTable\022\033\n\023version_requirement\030\037" + + " \003(\005\0229\n\010contract\030 \001(\0132\'.org.jetbrains.k" + + "otlin.metadata.Contract*\006\010d\020\270\224\001\"\323\004\n\010Prop" + + "erty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030\001 " + + "\001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013return_" + + "type\030\003 \001(\0132#.org.jetbrains.kotlin.metada" + + "ta.Type\022\034\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022D\n", + "\016type_parameter\030\004 \003(\0132,.org.jetbrains.ko" + + "tlin.metadata.TypeParameter\022:\n\rreceiver_" + + "type\030\005 \001(\0132#.org.jetbrains.kotlin.metada" + + "ta.Type\022\036\n\020receiver_type_id\030\n \001(\005B\004\240\265\030\001\022" + + "B\n\025context_receiver_type\030\014 \003(\0132#.org.jet" + + "brains.kotlin.metadata.Type\022(\n\030context_r" + + "eceiver_type_id\030\r \003(\005B\006\020\001\240\265\030\001\022M\n\026setter_" + + "value_parameter\030\006 \001(\0132-.org.jetbrains.ko" + + "tlin.metadata.ValueParameter\022\024\n\014getter_f" + + "lags\030\007 \001(\005\022\024\n\014setter_flags\030\010 \001(\005\022\033\n\023vers", + "ion_requirement\030\037 \003(\005*\006\010d\020\270\224\001\"\357\001\n\016ValueP" + + "arameter\022\020\n\005flags\030\001 \001(\005:\0010\022\022\n\004name\030\002 \002(\005" + + "B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#.org.jetbrains.kot" + + "lin.metadata.Type\022\025\n\007type_id\030\005 \001(\005B\004\240\265\030\001" + + "\022@\n\023vararg_element_type\030\004 \001(\0132#.org.jetb" + + "rains.kotlin.metadata.Type\022$\n\026vararg_ele" + + "ment_type_id\030\006 \001(\005B\004\240\265\030\001*\005\010d\020\310\001\"\226\003\n\tType" + + "Alias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210" + + "\265\030\001\022D\n\016type_parameter\030\003 \003(\0132,.org.jetbra" + + "ins.kotlin.metadata.TypeParameter\022<\n\017und", + "erlying_type\030\004 \001(\0132#.org.jetbrains.kotli" + + "n.metadata.Type\022 \n\022underlying_type_id\030\005 " + + "\001(\005B\004\240\265\030\001\022:\n\rexpanded_type\030\006 \001(\0132#.org.j" + + "etbrains.kotlin.metadata.Type\022\036\n\020expande" + + "d_type_id\030\007 \001(\005B\004\240\265\030\001\022=\n\nannotation\030\010 \003(" + + "\0132).org.jetbrains.kotlin.metadata.Annota" + + "tion\022\033\n\023version_requirement\030\037 \003(\005*\005\010d\020\310\001" + + "\"&\n\tEnumEntry\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001" + + "\"\225\003\n\022VersionRequirement\022\017\n\007version\030\001 \001(\005" + + "\022\024\n\014version_full\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.", "org.jetbrains.kotlin.metadata.VersionReq" + - "uirement.VersionKind:\020LANGUAGE_VERSION\"+", - "\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDE" + - "N\020\002\"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSION\020\000" + - "\022\024\n\020COMPILER_VERSION\020\001\022\017\n\013API_VERSION\020\002\"" + - "a\n\027VersionRequirementTable\022F\n\013requiremen" + - "t\030\001 \003(\01321.org.jetbrains.kotlin.metadata." + - "VersionRequirement\"\217\002\n\017PackageFragment\022;" + - "\n\007strings\030\001 \001(\0132*.org.jetbrains.kotlin.m" + - "etadata.StringTable\022J\n\017qualified_names\030\002" + - " \001(\01321.org.jetbrains.kotlin.metadata.Qua" + - "lifiedNameTable\0227\n\007package\030\003 \001(\0132&.org.j", - "etbrains.kotlin.metadata.Package\0223\n\005clas" + - "s\030\004 \003(\0132$.org.jetbrains.kotlin.metadata." + - "Class*\005\010d\020\310\001\"A\n\010Contract\0225\n\006effect\030\001 \003(\013" + - "2%.org.jetbrains.kotlin.metadata.Effect\"" + - "\306\003\n\006Effect\022E\n\013effect_type\030\001 \001(\01620.org.je" + - "tbrains.kotlin.metadata.Effect.EffectTyp" + - "e\022N\n\033effect_constructor_argument\030\002 \003(\0132)" + - ".org.jetbrains.kotlin.metadata.Expressio" + - "n\022S\n conclusion_of_conditional_effect\030\003 " + - "\001(\0132).org.jetbrains.kotlin.metadata.Expr", - "ession\022B\n\004kind\030\004 \001(\01624.org.jetbrains.kot" + - "lin.metadata.Effect.InvocationKind\"C\n\nEf" + - "fectType\022\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CALLS\020" + - "\001\022\024\n\020RETURNS_NOT_NULL\020\002\"G\n\016InvocationKin" + - "d\022\020\n\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001\022\021\n" + - "\rAT_LEAST_ONCE\020\002\"\245\003\n\nExpression\022\020\n\005flags" + - "\030\001 \001(\005:\0010\022!\n\031value_parameter_reference\030\002" + - " \001(\005\022O\n\016constant_value\030\003 \001(\01627.org.jetbr" + - "ains.kotlin.metadata.Expression.Constant" + - "Value\022=\n\020is_instance_type\030\004 \001(\0132#.org.je", - "tbrains.kotlin.metadata.Type\022!\n\023is_insta" + - "nce_type_id\030\005 \001(\005B\004\240\265\030\001\022?\n\014and_argument\030" + - "\006 \003(\0132).org.jetbrains.kotlin.metadata.Ex" + - "pression\022>\n\013or_argument\030\007 \003(\0132).org.jetb" + - "rains.kotlin.metadata.Expression\".\n\rCons" + - "tantValue\022\010\n\004TRUE\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\010ABS" + - "TRACT\020\002\022\n\n\006SEALED\020\003*b\n\nVisibility\022\014\n\010INT" + - "ERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006P" + - "UBLIC\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*", - "Q\n\nMemberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_O" + - "VERRIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED" + - "\020\003B\017B\rDebugProtoBuf" + "uirement.Level:\005ERROR\022\022\n\nerror_code\030\004 \001(" + + "\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind" + + "\030\006 \001(\0162=.org.jetbrains.kotlin.metadata.V" + + "ersionRequirement.VersionKind:\020LANGUAGE_" + + "VERSION\"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001" + + "\022\n\n\006HIDDEN\020\002\"J\n\013VersionKind\022\024\n\020LANGUAGE_" + + "VERSION\020\000\022\024\n\020COMPILER_VERSION\020\001\022\017\n\013API_V" + + "ERSION\020\002\"a\n\027VersionRequirementTable\022F\n\013r" + + "equirement\030\001 \003(\01321.org.jetbrains.kotlin.", + "metadata.VersionRequirement\"\217\002\n\017PackageF" + + "ragment\022;\n\007strings\030\001 \001(\0132*.org.jetbrains" + + ".kotlin.metadata.StringTable\022J\n\017qualifie" + + "d_names\030\002 \001(\01321.org.jetbrains.kotlin.met" + + "adata.QualifiedNameTable\0227\n\007package\030\003 \001(" + + "\0132&.org.jetbrains.kotlin.metadata.Packag" + + "e\0223\n\005class\030\004 \003(\0132$.org.jetbrains.kotlin." + + "metadata.Class*\005\010d\020\310\001\"A\n\010Contract\0225\n\006eff" + + "ect\030\001 \003(\0132%.org.jetbrains.kotlin.metadat" + + "a.Effect\"\306\003\n\006Effect\022E\n\013effect_type\030\001 \001(\016", + "20.org.jetbrains.kotlin.metadata.Effect." + + "EffectType\022N\n\033effect_constructor_argumen" + + "t\030\002 \003(\0132).org.jetbrains.kotlin.metadata." + + "Expression\022S\n conclusion_of_conditional_" + + "effect\030\003 \001(\0132).org.jetbrains.kotlin.meta" + + "data.Expression\022B\n\004kind\030\004 \001(\01624.org.jetb" + + "rains.kotlin.metadata.Effect.InvocationK" + + "ind\"C\n\nEffectType\022\024\n\020RETURNS_CONSTANT\020\000\022" + + "\t\n\005CALLS\020\001\022\024\n\020RETURNS_NOT_NULL\020\002\"G\n\016Invo" + + "cationKind\022\020\n\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_", + "ONCE\020\001\022\021\n\rAT_LEAST_ONCE\020\002\"\245\003\n\nExpression" + + "\022\020\n\005flags\030\001 \001(\005:\0010\022!\n\031value_parameter_re" + + "ference\030\002 \001(\005\022O\n\016constant_value\030\003 \001(\01627." + + "org.jetbrains.kotlin.metadata.Expression" + + ".ConstantValue\022=\n\020is_instance_type\030\004 \001(\013" + + "2#.org.jetbrains.kotlin.metadata.Type\022!\n" + + "\023is_instance_type_id\030\005 \001(\005B\004\240\265\030\001\022?\n\014and_" + + "argument\030\006 \003(\0132).org.jetbrains.kotlin.me" + + "tadata.Expression\022>\n\013or_argument\030\007 \003(\0132)" + + ".org.jetbrains.kotlin.metadata.Expressio", + "n\".\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\005FINAL\020\000\022\010\n\004OPEN" + + "\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003*b\n\nVisibili" + + "ty\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECT" + + "ED\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\013DECLARATION\020\000\022" + + "\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SY" + + "NTHESIZED\020\003B\017B\rDebugProtoBuf" }; org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -38169,19 +37283,7 @@ public final class DebugProtoBuf { internal_static_org_jetbrains_kotlin_metadata_Class_fieldAccessorTable = new org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_kotlin_metadata_Class_descriptor, - new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "ContextReceiverType", "ContextReceiverTypeId", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "InlineClassUnderlyingPropertyName", "InlineClassUnderlyingType", "InlineClassUnderlyingTypeId", "MultiFieldValueClassRepresentation", "TypeTable", "VersionRequirement", "VersionRequirementTable", }); - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor = - internal_static_org_jetbrains_kotlin_metadata_Class_descriptor.getNestedTypes().get(0); - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_fieldAccessorTable = new - org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor, - new java.lang.String[] { "Property", }); - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor = - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_descriptor.getNestedTypes().get(0); - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_fieldAccessorTable = new - org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_org_jetbrains_kotlin_metadata_Class_MultiFieldValueClassRepresentation_MultiFieldValueClassProperty_descriptor, - new java.lang.String[] { "Name", "Type", "TypeId", }); + new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "ContextReceiverType", "ContextReceiverTypeId", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "InlineClassUnderlyingPropertyName", "InlineClassUnderlyingType", "InlineClassUnderlyingTypeId", "MultiFieldValueClassUnderlyingName", "MultiFieldValueClassUnderlyingType", "MultiFieldValueClassUnderlyingTypeId", "TypeTable", "VersionRequirement", "VersionRequirementTable", }); internal_static_org_jetbrains_kotlin_metadata_Package_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_org_jetbrains_kotlin_metadata_Package_fieldAccessorTable = new @@ -38293,6 +37395,8 @@ public final class DebugProtoBuf { registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable); registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable); + registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable); + registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable); registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison); registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java index de4c989c4ad..fe87c8a4a34 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java @@ -59,6 +59,7 @@ import static org.jetbrains.kotlin.codegen.DescriptorAsmUtil.*; import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isConst; import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.CLOSURE; import static org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.METHOD_FOR_FUNCTION; +import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getInlineClassRepresentation; import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; import static org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin.NO_ORIGIN; import static org.jetbrains.org.objectweb.asm.Opcodes.*; @@ -382,8 +383,7 @@ public class ClosureCodegen extends MemberCodegen { } if (InlineClassesCodegenUtilKt.isInlineClassWithUnderlyingTypeAnyOrAnyN(parameterType) && functionReferenceCall == null) { ClassDescriptor descriptor = TypeUtils.getClassDescriptor(parameterType); - InlineClassRepresentation representation = - descriptor != null ? descriptor.getInlineClassRepresentation() : null; + InlineClassRepresentation representation = getInlineClassRepresentation(descriptor); assert representation != null : "Not an inline class type: " + parameterType; parameterType = representation.getUnderlyingType(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 4be79da8716..1ec3123f3d9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -117,6 +117,7 @@ import static org.jetbrains.kotlin.resolve.BindingContext.*; import static org.jetbrains.kotlin.resolve.BindingContextUtils.getDelegationConstructorCall; import static org.jetbrains.kotlin.resolve.BindingContextUtils.isBoxedLocalCapturedInClosure; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; +import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getInlineClassRepresentation; import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; import static org.jetbrains.kotlin.types.RangeUtilKt.isPrimitiveNumberClassDescriptor; import static org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils.isFunctionExpression; @@ -1998,8 +1999,7 @@ public class ExpressionCodegen extends KtVisitor impleme !CoroutineCodegenUtilKt.isInvokeSuspendOfLambda(context.getFunctionDescriptor()) ) { ClassDescriptor inlineClass = (ClassDescriptor) inlineClassType.getConstructor().getDeclarationDescriptor(); - InlineClassRepresentation representation = - inlineClass != null ? inlineClass.getInlineClassRepresentation() : null; + InlineClassRepresentation representation = getInlineClassRepresentation(inlineClass); assert representation != null : "Not an inline class: " + inlineClassType; KotlinType underlyingType = representation.getUnderlyingType(); return StackValue.underlyingValueOfInlineClass(typeMapper.mapType(underlyingType), underlyingType, localOrCaptured); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index 54accf962a3..fb8c7f6d90d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -79,6 +79,7 @@ import static org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DEL import static org.jetbrains.kotlin.descriptors.ModalityUtilsKt.isOverridable; import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.getSourceFromDescriptor; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; +import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getInlineClassRepresentation; import static org.jetbrains.kotlin.resolve.inline.InlineOnlyKt.isInlineOnlyPrivateInBytecode; import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE; import static org.jetbrains.kotlin.resolve.jvm.InlineClassManglingRulesKt.shouldHideConstructorDueToInlineClassTypeValueParameters; @@ -378,7 +379,7 @@ public class FunctionCodegen { Type fieldOwnerType = typeMapper.mapClass(inlineClass); Method erasedMethodImpl = typeMapper.mapAsmMethod(functionDescriptor.getOriginal(), OwnerKind.ERASED_INLINE_CLASS); - InlineClassRepresentation representation = inlineClass.getInlineClassRepresentation(); + InlineClassRepresentation representation = getInlineClassRepresentation(inlineClass); assert representation != null : "Not an inline class: " + inlineClass; generateDelegateToStaticErasedVersion( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 1cc0a0a19d8..fae2ea25b9e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -82,6 +82,7 @@ import static org.jetbrains.kotlin.resolve.BindingContext.INDEXED_LVALUE_SET; import static org.jetbrains.kotlin.resolve.BindingContextUtils.getNotNull; import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.descriptorToDeclaration; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; +import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getInlineClassRepresentation; import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE; import static org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin.NO_ORIGIN; import static org.jetbrains.kotlin.types.Variance.INVARIANT; @@ -276,7 +277,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { @Override protected void generateUnboxMethodForInlineClass() { if (!(myClass instanceof KtClass)) return; - InlineClassRepresentation inlineClassRepresentation = descriptor.getInlineClassRepresentation(); + InlineClassRepresentation inlineClassRepresentation = getInlineClassRepresentation(descriptor); if (inlineClassRepresentation == null) return; Type ownerType = typeMapper.mapClass(descriptor); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inlineClassesCodegenUtil.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inlineClassesCodegenUtil.kt index 10f062d4f7a..42c250ccda0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inlineClassesCodegenUtil.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inlineClassesCodegenUtil.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource import org.jetbrains.kotlin.load.kotlin.VirtualFileFinder import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.resolve.descriptorUtil.classId +import org.jetbrains.kotlin.resolve.descriptorUtil.inlineClassRepresentation import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor import org.jetbrains.kotlin.types.KotlinType diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index d7e05597bdf..770f55f618f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -643,21 +643,10 @@ fun Fir2IrComponents.createTemporaryVariableForSafeCallConstruction( ): Pair = createTemporaryVariable(receiverExpression, conversionScope, "safe_receiver") -// TODO: implement inlineClassRepresentation in FirRegularClass instead. -fun Fir2IrComponents.computeInlineClassRepresentation(klass: FirRegularClass): InlineClassRepresentation? { - if (!(klass.isInline && klass.primaryConstructorIfAny(session)?.valueParameterSymbols?.size == 1)) return null - val parameter = klass.getInlineClassUnderlyingParameter(session) ?: error("Inline class has no underlying parameter: ${klass.render()}") - val underlyingType = parameter.returnTypeRef.toIrType(typeConverter) - return InlineClassRepresentation( - parameter.name, - underlyingType as? IrSimpleType ?: error("Inline class underlying type is not a simple type: ${klass.render()}") - ) -} - -// TODO: implement multiFieldValueClassRepresentation in FirRegularClass instead. -fun Fir2IrComponents.computeMultiFieldValueClassRepresentation(klass: FirRegularClass): MultiFieldValueClassRepresentation? { - val parameters = klass.getMultiFieldValueClassUnderlyingParameters(session) ?: return null - return MultiFieldValueClassRepresentation(parameters.map { +// TODO: implement valueClassRepresentation in FirRegularClass instead. zhelenskiy +fun Fir2IrComponents.computeValueClassRepresentation(klass: FirRegularClass): ValueClassRepresentation? { + val parameters = klass.getValueClassUnderlyingParameters(session) ?: return null + return createValueClassRepresentation(IrTypeSystemContextImpl(irBuiltIns), parameters.map { val type = it.returnTypeRef.toIrType(typeConverter).safeAs() ?: error("Value class underlying type is not a simple type: ${klass.render()}") it.name to type diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt index 7f48d2cbfe4..ee8008b1c2a 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt @@ -133,9 +133,9 @@ class Fir2IrClassifierStorage( superTypes = klass.superTypeRefs.map { superTypeRef -> superTypeRef.toIrType() } } - private fun IrClass.declareInlineClassRepresentation(klass: FirRegularClass) { + private fun IrClass.declareValueClassRepresentation(klass: FirRegularClass) { if (this !is Fir2IrLazyClass) { - inlineClassRepresentation = computeInlineClassRepresentation(klass) + valueClassRepresentation = computeValueClassRepresentation(klass) } } @@ -216,7 +216,7 @@ class Fir2IrClassifierStorage( irClass.declareTypeParameters(regularClass) irClass.setThisReceiver(regularClass.typeParameters) irClass.declareSupertypes(regularClass) - irClass.declareInlineClassRepresentation(regularClass) + irClass.declareValueClassRepresentation(regularClass) return irClass } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt index 19b91986d21..be20b446402 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt @@ -134,13 +134,8 @@ class Fir2IrLazyClass( receiver } - override var inlineClassRepresentation: InlineClassRepresentation? - get() = computeInlineClassRepresentation(fir) - set(_) { - error("Mutating Fir2Ir lazy elements is not possible") - } - override var multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? - get() = computeMultiFieldValueClassRepresentation(fir) + override var valueClassRepresentation: ValueClassRepresentation? + get() = computeValueClassRepresentation(fir) set(_) { error("Mutating Fir2Ir lazy elements is not possible") } diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/InlineClassesUtils.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/InlineClassesUtils.kt deleted file mode 100644 index 1a87b85f3e0..00000000000 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/declarations/InlineClassesUtils.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.fir.declarations - -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.utils.isInline -import org.jetbrains.kotlin.fir.resolve.fullyExpandedType -import org.jetbrains.kotlin.fir.resolve.substitution.createTypeSubstitutorByTypeConstructor -import org.jetbrains.kotlin.fir.resolve.toSymbol -import org.jetbrains.kotlin.fir.symbols.ensureResolved -import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol -import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.fir.types.ConeLookupTagBasedType -import org.jetbrains.kotlin.fir.types.ConeTypeContext -import org.jetbrains.kotlin.fir.types.coneType -import org.jetbrains.kotlin.types.model.typeConstructor - -internal fun ConeKotlinType.substitutedUnderlyingTypeForInlineClass(session: FirSession, context: ConeTypeContext): ConeKotlinType? { - val unsubstitutedType = unsubstitutedUnderlyingTypeForInlineClass(session) ?: return null - val substitutor = createTypeSubstitutorByTypeConstructor( - mapOf(this.typeConstructor(context) to this), context, approximateIntegerLiterals = true - ) - return substitutor.substituteOrNull(unsubstitutedType) -} - -internal fun ConeKotlinType.unsubstitutedUnderlyingTypeForInlineClass(session: FirSession): ConeKotlinType? { - val symbol = (this.fullyExpandedType(session) as? ConeLookupTagBasedType) - ?.lookupTag - ?.toSymbol(session) as? FirRegularClassSymbol - ?: return null - symbol.ensureResolved(FirResolvePhase.STATUS) - return symbol.fir.getInlineClassUnderlyingParameter(session)?.returnTypeRef?.coneType -} - -// TODO: implement inlineClassRepresentation in FirRegularClass instead. -fun FirRegularClass.getInlineClassUnderlyingParameter(session: FirSession): FirValueParameter? = - if (isInline) primaryConstructorIfAny(session)?.fir?.valueParameters?.singleOrNull() else null - -fun FirRegularClass.getMultiFieldValueClassUnderlyingParameters(session: FirSession): List? = - if (isInline) primaryConstructorIfAny(session)?.fir?.valueParameters?.takeIf { it.size > 1 } else null diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt index 7a32117b7e8..7bdf8f82504 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt @@ -9,6 +9,8 @@ import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.ValueClassKind +import org.jetbrains.kotlin.descriptors.valueClassLoweringKind import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.utils.* @@ -22,10 +24,7 @@ import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag import org.jetbrains.kotlin.fir.symbols.ensureResolved import org.jetbrains.kotlin.fir.symbols.impl.* -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.name.FqNameUnsafe -import org.jetbrains.kotlin.name.SpecialNames -import org.jetbrains.kotlin.name.StandardClassIds +import org.jetbrains.kotlin.name.* import org.jetbrains.kotlin.types.TypeCheckerState import org.jetbrains.kotlin.types.TypeCheckerState.SupertypesPolicy.DoCustomTransform import org.jetbrains.kotlin.types.TypeCheckerState.SupertypesPolicy.LowerIfFlexible @@ -552,7 +551,17 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty } override fun TypeConstructorMarker.isInlineClass(): Boolean { - return toFirRegularClass()?.isInline == true + val fields = getValueClassProperties() ?: return false + return this@ConeTypeContext.valueClassLoweringKind(fields) == ValueClassKind.Inline + } + + override fun TypeConstructorMarker.isMultiFieldValueClass(): Boolean { + val fields = getValueClassProperties() ?: return false + return this@ConeTypeContext.valueClassLoweringKind(fields) == ValueClassKind.MultiField + } + + override fun TypeConstructorMarker.getValueClassProperties(): List>? { + return toFirRegularClass()?.valueClassRepresentation?.underlyingPropertyNamesToTypes } override fun TypeConstructorMarker.isInnerClass(): Boolean { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/synthetics/SyntheticClassOrObjectDescriptor.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/synthetics/SyntheticClassOrObjectDescriptor.kt index ac01b918ef4..f011321053d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/synthetics/SyntheticClassOrObjectDescriptor.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/synthetics/SyntheticClassOrObjectDescriptor.kt @@ -94,8 +94,7 @@ class SyntheticClassOrObjectDescriptor( override fun getStaticScope() = MemberScope.Empty override fun getUnsubstitutedMemberScope(kotlinTypeRefiner: KotlinTypeRefiner) = unsubstitutedMemberScope override fun getSealedSubclasses() = emptyList() - override fun getInlineClassRepresentation(): InlineClassRepresentation? = null - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = null + override fun getValueClassRepresentation(): ValueClassRepresentation? = null init { assert(modality != Modality.SEALED) { "Implement getSealedSubclasses() for this class: ${this::class.java}" } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt index 2ab36985073..b1565773681 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt @@ -271,7 +271,7 @@ class DeclarationsChecker( if (declaration is KtPrimaryConstructor && !DescriptorUtils.isAnnotationClass(constructorDescriptor.constructedClass) && - !constructorDescriptor.constructedClass.isInlineOrValueClass() + !constructorDescriptor.constructedClass.isValueClass() ) { for (parameter in declaration.valueParameters) { if (parameter.hasValOrVar()) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/InlineClassDescriptorResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/InlineClassDescriptorResolver.kt index e198ccbd104..3369ffa5911 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/InlineClassDescriptorResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/InlineClassDescriptorResolver.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns +import org.jetbrains.kotlin.resolve.descriptorUtil.inlineClassRepresentation import org.jetbrains.kotlin.types.KotlinType object InlineClassDescriptorResolver { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/InlineClassDeclarationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/InlineClassDeclarationChecker.kt index 3d51798ad8a..276f6063952 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/InlineClassDeclarationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/InlineClassDeclarationChecker.kt @@ -77,7 +77,7 @@ object InlineClassDeclarationChecker : DeclarationChecker { return } - if (context.languageVersionSettings.supportsFeature(LanguageFeature.ValueClasses) && descriptor.isValueClass()) { + if (context.languageVersionSettings.supportsFeature(LanguageFeature.ValueClasses)) { if (primaryConstructor.valueParameters.isEmpty()) { (primaryConstructor.valueParameterList ?: declaration).let { trace.report(Errors.VALUE_CLASS_EMPTY_CONSTRUCTOR.on(it)) @@ -176,7 +176,7 @@ class PropertiesWithBackingFieldsInsideInlineClass : DeclarationChecker { if (declaration !is KtProperty) return if (descriptor !is PropertyDescriptor) return - if (!descriptor.containingDeclaration.isInlineOrValueClass()) return + if (!descriptor.containingDeclaration.isValueClass()) return if (context.trace.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor) == true) { context.trace.report(Errors.PROPERTY_WITH_BACKING_FIELD_INSIDE_VALUE_CLASS.on(declaration)) @@ -194,7 +194,7 @@ class InnerClassInsideInlineClass : DeclarationChecker { if (descriptor !is ClassDescriptor) return if (!descriptor.isInner) return - if (!descriptor.containingDeclaration.isInlineOrValueClass()) return + if (!descriptor.containingDeclaration.isValueClass()) return context.trace.report(Errors.INNER_CLASS_INSIDE_VALUE_CLASS.on(declaration.modifierList!!.getModifier(KtTokens.INNER_KEYWORD)!!)) } @@ -208,7 +208,7 @@ class ReservedMembersAndConstructsForInlineClass : DeclarationChecker { override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) { val containingDeclaration = descriptor.containingDeclaration ?: return - if (!containingDeclaration.isInlineOrValueClass()) return + if (!containingDeclaration.isValueClass()) return if (descriptor !is FunctionDescriptor) return diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt index 2aaac2826ef..4edaabdedad 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt @@ -23,8 +23,6 @@ import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.diagnostics.reportDiagnosticOnce import org.jetbrains.kotlin.incremental.components.InlineConstTracker import org.jetbrains.kotlin.lexer.KtTokens -import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject -import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.parsing.* @@ -32,15 +30,18 @@ import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType import org.jetbrains.kotlin.resolve.* import org.jetbrains.kotlin.resolve.BindingContext.COLLECTION_LITERAL_CALL -import org.jetbrains.kotlin.resolve.calls.util.getEffectiveExpectedType -import org.jetbrains.kotlin.resolve.calls.util.getResolvedCall import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind +import org.jetbrains.kotlin.resolve.calls.util.getEffectiveExpectedType +import org.jetbrains.kotlin.resolve.calls.util.getResolvedCall import org.jetbrains.kotlin.resolve.checkers.ExperimentalUsageChecker import org.jetbrains.kotlin.resolve.constants.* import org.jetbrains.kotlin.resolve.constants.evaluate.CompileTimeType.* import org.jetbrains.kotlin.resolve.descriptorUtil.classId +import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe +import org.jetbrains.kotlin.resolve.descriptorUtil.inlineClassRepresentation +import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.SimpleType import org.jetbrains.kotlin.types.TypeUtils @@ -52,7 +53,6 @@ import org.jetbrains.kotlin.types.typeUtil.isBoolean import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf import org.jetbrains.kotlin.util.OperatorNameConventions import java.math.BigInteger -import java.util.* class ConstantExpressionEvaluator( internal val module: ModuleDescriptor, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java index e4cfdd86893..441a226ce36 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorBase; import org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl; -import org.jetbrains.kotlin.descriptors.impl.ReceiverParameterDescriptorImpl; import org.jetbrains.kotlin.diagnostics.DiagnosticFactory0; import org.jetbrains.kotlin.incremental.components.NoLookupLocation; import org.jetbrains.kotlin.lexer.KtTokens; @@ -41,7 +40,6 @@ import org.jetbrains.kotlin.resolve.lazy.declarations.ClassMemberDeclarationProv import org.jetbrains.kotlin.resolve.scopes.LexicalScope; import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.resolve.scopes.StaticScopeForKotlinEnum; -import org.jetbrains.kotlin.resolve.scopes.receivers.ContextClassReceiver; import org.jetbrains.kotlin.resolve.source.KotlinSourceElementKt; import org.jetbrains.kotlin.storage.MemoizedFunctionToNotNull; import org.jetbrains.kotlin.storage.NotNullLazyValue; @@ -631,43 +629,49 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes @Nullable @Override - public InlineClassRepresentation getInlineClassRepresentation() { - if (!InlineClassesUtilsKt.isInlineClass(this)) return null; - - ClassConstructorDescriptor constructor = getUnsubstitutedPrimaryConstructor(); - if (constructor != null) { - ValueParameterDescriptor parameter = firstOrNull(constructor.getValueParameters()); - if (parameter != null) { - return new InlineClassRepresentation<>(parameter.getName(), (SimpleType) parameter.getType()); - } + public ValueClassRepresentation getValueClassRepresentation() { + if (!this.isValue && !this.isInline) { + return null; } + ClassConstructorDescriptor constructor = getUnsubstitutedPrimaryConstructor(); // Don't crash on invalid code. - return new InlineClassRepresentation<>( + InlineClassRepresentation invalidValueClassRepresentation = new InlineClassRepresentation<>( SpecialNames.SAFE_IDENTIFIER_FOR_NO_NAME, c.getModuleDescriptor().getBuiltIns().getAnyType() ); - } - - @Nullable - @Override - public MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - if (!InlineClassesUtilsKt.isValueClass(this) || InlineClassesUtilsKt.isInlineClass(this)) { - return null; - } - - ClassConstructorDescriptor constructor = getUnsubstitutedPrimaryConstructor(); - // Don't crash on invalid code. It is IC, not MFVC. if (constructor == null) { - return null; + return invalidValueClassRepresentation; } List parameters = constructor.getValueParameters(); - if (parameters.size() <= 1) { - return null; + SimpleClassicTypeSystemContext context = SimpleClassicTypeSystemContext.INSTANCE; + if (isRecursiveInlineClass(constructor, new HashSet<>())) { + return new InlineClassRepresentation<>(parameters.get(0).getName(), (SimpleType) parameters.get(0).getType()); } - List> properties = parameters.stream() + if (parameters.size() == 0) { + return invalidValueClassRepresentation; + } + List> fields = parameters.stream() .map(parameter -> new Pair<>(parameter.getName(), (SimpleType) parameter.getType())) .collect(Collectors.toList()); - return new MultiFieldValueClassRepresentation<>(properties); + return ValueClassRepresentationKt.createValueClassRepresentation(context, fields); + } + + private static boolean isRecursiveInlineClass(@Nullable ClassConstructorDescriptor constructor, @NotNull Set visited) { + if (constructor == null || constructor.getValueParameters().size() != 1 || + !(constructor.getConstructedClass().isValue() || constructor.getConstructedClass().isInline())) { + return false; + } + if (!visited.add(constructor.getConstructedClass())) { + return true; + } + SimpleType type = (SimpleType) constructor.getValueParameters().get(0).getType(); + + ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor(); + if (descriptor instanceof ClassDescriptor) { + ClassConstructorDescriptor newConstructor = ((ClassDescriptor) descriptor).getUnsubstitutedPrimaryConstructor(); + return isRecursiveInlineClass(newConstructor, visited); + } + return false; } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt index e9aaae9ea83..1062505010b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt @@ -296,7 +296,7 @@ open class LazyClassMemberScope( } result.addAll(generateDelegatingDescriptors(name, EXTRACT_FUNCTIONS, result)) generateDataClassMethods(result, name, location, fromSupertypes) - generateFunctionsFromAnyForInlineClass(result, name, fromSupertypes) + generateFunctionsFromAnyForValueClass(result, name, fromSupertypes) c.syntheticResolveExtension.generateSyntheticMethods(thisDescriptor, name, trace.bindingContext, fromSupertypes, result) c.additionalClassPartsProvider.generateAdditionalMethods(thisDescriptor, result, name, location, fromSupertypes) @@ -304,12 +304,12 @@ open class LazyClassMemberScope( generateFakeOverrides(name, fromSupertypes, result, SimpleFunctionDescriptor::class.java) } - private fun generateFunctionsFromAnyForInlineClass( + private fun generateFunctionsFromAnyForValueClass( result: MutableCollection, name: Name, fromSupertypes: List ) { - if (!thisDescriptor.isInlineOrValueClass()) return + if (!thisDescriptor.isValueClass()) return FunctionsFromAny.addFunctionFromAnyIfNeeded(thisDescriptor, result, name, fromSupertypes) } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/calls/EqualityAndComparisonCallsTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/calls/EqualityAndComparisonCallsTransformer.kt index dda6feaaf20..e74e8f427e0 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/calls/EqualityAndComparisonCallsTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/calls/EqualityAndComparisonCallsTransformer.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.ir.backend.js.lower.calls +import org.jetbrains.kotlin.descriptors.InlineClassRepresentation import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder import org.jetbrains.kotlin.ir.backend.js.utils.isEqualsInheritedFromAny @@ -17,6 +18,7 @@ import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.utils.addToStdlib.safeAs class EqualityAndComparisonCallsTransformer(context: JsIrBackendContext) : CallsTransformer { diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmInlineMultiFieldValueClassLowering.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmMultiFieldValueClassLowering.kt similarity index 95% rename from compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmInlineMultiFieldValueClassLowering.kt rename to compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmMultiFieldValueClassLowering.kt index edf9629998d..3342d36be91 100644 --- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmInlineMultiFieldValueClassLowering.kt +++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmMultiFieldValueClassLowering.kt @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.backend.jvm.isMultiFieldValueClassFieldGetter import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* -private class JvmInlineMultiFieldValueClassLowering(context: JvmBackendContext) : JvmValueClassAbstractLowering(context) { +private class JvmMultiFieldValueClassLowering(context: JvmBackendContext) : JvmValueClassAbstractLowering(context) { override val replacements: MemoizedValueClassAbstractReplacements get() = context.multiFieldValueClassReplacements diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmValueClassAbstractLowering.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmValueClassAbstractLowering.kt index ea1909a4384..09abc4cde62 100644 --- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmValueClassAbstractLowering.kt +++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmValueClassAbstractLowering.kt @@ -121,14 +121,6 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon protected abstract fun addJvmInlineAnnotation(valueClass: IrClass) -// abstract override fun visitFunctionReference(expression: IrFunctionReference): IrExpression - -// abstract override fun visitFunctionAccess(expression: IrFunctionAccessExpression): IrExpression - -// abstract override fun visitCall(expression: IrCall): IrExpression - -// abstract override fun visitGetField(expression: IrGetField): IrExpression - final override fun visitReturn(expression: IrReturn): IrExpression { expression.returnTargetSymbol.owner.safeAs()?.let { target -> val suffix = target.hashSuffix() diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendContext.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendContext.kt index d4a3b0b8586..53e932d9bcb 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendContext.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendContext.kt @@ -129,8 +129,7 @@ class JvmBackendContext( val inlineClassReplacements = MemoizedInlineClassReplacements(state.functionsWithInlineClassReturnTypesMangled, irFactory, this) - val multiFieldValueClassReplacements = - MemoizedMultiFieldValueClassReplacements(state.functionsWithInlineClassReturnTypesMangled, irFactory, this) + val multiFieldValueClassReplacements = MemoizedMultiFieldValueClassReplacements(irFactory, this) val continuationClassesVarsCountByType: MutableMap> = hashMapOf() diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt index dfc9be2dd6b..078784645a7 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt @@ -273,7 +273,7 @@ class JvmSymbols( private val resultClassStub: IrClassSymbol = createClass(StandardNames.RESULT_FQ_NAME, classIsValue = true) { klass -> klass.addTypeParameter("T", irBuiltIns.anyNType, Variance.OUT_VARIANCE) - klass.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("value"), irBuiltIns.anyNType as IrSimpleType) + klass.valueClassRepresentation = InlineClassRepresentation(Name.identifier("value"), irBuiltIns.anyNType as IrSimpleType) } val resultOfAnyType: IrType = resultClassStub.typeWith(irBuiltIns.anyNType) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedInlineClassReplacements.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedInlineClassReplacements.kt index acafe19a24f..223caca7524 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedInlineClassReplacements.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedInlineClassReplacements.kt @@ -40,7 +40,7 @@ class MemoizedInlineClassReplacements( private val storageManager = LockBasedStorageManager("inline-class-replacements") private val propertyMap = ConcurrentHashMap() - val originalFunctionForStaticReplacement: MutableMap = ConcurrentHashMap() + override val originalFunctionForStaticReplacement: MutableMap = ConcurrentHashMap() internal val originalFunctionForMethodReplacement: MutableMap = ConcurrentHashMap() /** diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedMultiFieldValueClassReplacements.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedMultiFieldValueClassReplacements.kt index a3f9472e1f7..34d71dfae8c 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedMultiFieldValueClassReplacements.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedMultiFieldValueClassReplacements.kt @@ -5,298 +5,28 @@ package org.jetbrains.kotlin.backend.jvm -import org.jetbrains.kotlin.backend.common.ir.copyTo -import org.jetbrains.kotlin.backend.common.ir.copyTypeParameters -import org.jetbrains.kotlin.backend.jvm.ir.* -import org.jetbrains.kotlin.descriptors.DescriptorVisibilities -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.ir.builders.declarations.buildFun -import org.jetbrains.kotlin.ir.builders.declarations.buildProperty -import org.jetbrains.kotlin.ir.declarations.* -import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol -import org.jetbrains.kotlin.ir.types.isInt -import org.jetbrains.kotlin.ir.util.* -import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.ir.declarations.IrFactory +import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.storage.LockBasedStorageManager -import org.jetbrains.kotlin.utils.addToStdlib.safeAs import java.util.concurrent.ConcurrentHashMap /** * Keeps track of replacement functions and multi-field value class box/unbox functions. */ class MemoizedMultiFieldValueClassReplacements( - private val mangleReturnTypes: Boolean, // todo always false irFactory: IrFactory, context: JvmBackendContext -) : MemoizedValueClassAbstractReplacements(irFactory, context) { // There is only sample logic yet +) : MemoizedValueClassAbstractReplacements(irFactory, context) { private val storageManager = LockBasedStorageManager("multi-field-value-class-replacements") - private val propertyMap = ConcurrentHashMap() - val originalFunctionForStaticReplacement: MutableMap = ConcurrentHashMap() + override val originalFunctionForStaticReplacement: MutableMap = ConcurrentHashMap() internal val originalFunctionForMethodReplacement: MutableMap = ConcurrentHashMap() /** * Get a replacement for a function or a constructor. */ override val getReplacementFunction: (IrFunction) -> IrSimpleFunction? = storageManager.createMemoizedFunctionWithNullableValues { - when { - // Don't mangle anonymous or synthetic functions, except for generated SAM wrapper methods - (it.isLocal && it is IrSimpleFunction && it.overriddenSymbols.isEmpty()) || - (it.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR && it.visibility == DescriptorVisibilities.LOCAL) || - it.isStaticInlineClassReplacement || - it.origin.isSynthetic && it.origin != IrDeclarationOrigin.SYNTHETIC_GENERATED_SAM_IMPLEMENTATION -> - null - - it.isMultiFieldValueClassFieldGetter -> - if (it.hasMangledReturnType) - createMethodReplacement(it) - else - null - - // Mangle all functions in the body of an inline class - it.parent.safeAs()?.isMultiFieldValueClass == true -> - when { - it.isRemoveAtSpecialBuiltinStub() -> - null - it.isInlineClassMemberFakeOverriddenFromJvmDefaultInterfaceMethod() || - it.origin == IrDeclarationOrigin.IR_BUILTINS_STUB -> - createMethodReplacement(it) - else -> - createStaticReplacement(it) - } - - // Otherwise, mangle functions with mangled parameters, ignoring constructors - it is IrSimpleFunction && !it.isFromJava() && (it.hasMangledParameters || mangleReturnTypes && it.hasMangledReturnType) -> - createMethodReplacement(it) - - else -> - null - } - } - - private fun IrFunction.isRemoveAtSpecialBuiltinStub() = - origin == IrDeclarationOrigin.IR_BUILTINS_STUB && - name.asString() == "remove" && - valueParameters.size == 1 && - valueParameters[0].type.isInt() - - private fun IrFunction.isInlineClassMemberFakeOverriddenFromJvmDefaultInterfaceMethod(): Boolean { - if (this !is IrSimpleFunction) return false - if (!this.isFakeOverride) return false - val parentClass = parentClassOrNull ?: return false - if (!parentClass.isMultiFieldValueClass) return false - - val overridden = resolveFakeOverride() ?: return false - if (!overridden.parentAsClass.isJvmInterface) return false - if (overridden.modality == Modality.ABSTRACT) return false - - // We have a non-abstract interface member. - // It is a JVM default interface method if one of the following conditions are true: - // - it is a Java method, - // - it is a Kotlin function compiled to JVM default interface method. - return overridden.isFromJava() || overridden.isCompiledToJvmDefault(context.state.jvmDefaultMode) - } - -// /** -// * Get the box function for an inline class. Concretely, this is a synthetic -// * static function named "box-impl" which takes an unboxed value and returns -// * a boxed value. -// */ -// val getBoxFunction: (IrClass) -> IrSimpleFunction = -// storageManager.createMemoizedFunction { irClass -> -// require(irClass.isSingleFieldValueClass) -// irFactory.buildFun { -// name = Name.identifier(KotlinTypeMapper.BOX_JVM_METHOD_NAME) -// origin = JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER -// returnType = irClass.defaultType -// }.apply { -// parent = irClass -// copyTypeParametersFrom(irClass) -// addValueParameter { -// name = InlineClassDescriptorResolver.BOXING_VALUE_PARAMETER_NAME -// type = irClass.inlineClassRepresentation!!.underlyingType -// } -// } -// } -// -// /** -// * Get the unbox function for an inline class. Concretely, this is a synthetic -// * member function named "unbox-impl" which returns an unboxed result. -// */ -// val getUnboxFunction: (IrClass) -> IrSimpleFunction = -// storageManager.createMemoizedFunction { irClass -> -// require(irClass.isSingleFieldValueClass) -// irFactory.buildFun { -// name = Name.identifier(KotlinTypeMapper.UNBOX_JVM_METHOD_NAME) -// origin = JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER -// returnType = irClass.inlineClassRepresentation!!.underlyingType -// }.apply { -// parent = irClass -// createDispatchReceiverParameter() -// } -// } -// -// private val specializedEqualsCache = storageManager.createCacheWithNotNullValues() -// fun getSpecializedEqualsMethod(irClass: IrClass, irBuiltIns: IrBuiltIns): IrSimpleFunction { -// require(irClass.isSingleFieldValueClass) -// return specializedEqualsCache.computeIfAbsent(irClass) { -// irFactory.buildFun { -// name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME -// // TODO: Revisit this once we allow user defined equals methods in inline classes. -// origin = JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD -// returnType = irBuiltIns.booleanType -// }.apply { -// parent = irClass -// // We ignore type arguments here, since there is no good way to go from type arguments to types in the IR anyway. -// val typeArgument = -// IrSimpleTypeImpl(null, irClass.symbol, false, List(irClass.typeParameters.size) { IrStarProjectionImpl }, listOf()) -// addValueParameter { -// name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_FIRST_PARAMETER_NAME -// type = typeArgument -// } -// addValueParameter { -// name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_SECOND_PARAMETER_NAME -// type = typeArgument -// } -// } -// } -// } - - private fun createMethodReplacement(function: IrFunction): IrSimpleFunction = - buildReplacement(function, function.origin) { - originalFunctionForMethodReplacement[this] = function - dispatchReceiverParameter = function.dispatchReceiverParameter?.copyTo(this, index = -1) - extensionReceiverParameter = function.extensionReceiverParameter?.copyTo( - // The function's name will be mangled, so preserve the old receiver name. - this, index = -1, name = Name.identifier(function.extensionReceiverName(context.state)) - ) - contextReceiverParametersCount = function.contextReceiverParametersCount - valueParameters = function.valueParameters.mapIndexed { index, parameter -> - parameter.copyTo(this, index = index, defaultValue = null).also { - // Assuming that constructors and non-override functions are always replaced with the unboxed - // equivalent, deep-copying the value here is unnecessary. See `JvmInlineClassLowering`. - it.defaultValue = parameter.defaultValue?.patchDeclarationParents(this) - } - } - } - - private fun createStaticReplacement(function: IrFunction): IrSimpleFunction = - buildReplacement(function, JvmLoweredDeclarationOrigin.STATIC_INLINE_CLASS_REPLACEMENT, noFakeOverride = true) { - originalFunctionForStaticReplacement[this] = function - - val newValueParameters = mutableListOf() - if (function.dispatchReceiverParameter != null) { - // FAKE_OVERRIDEs have broken dispatch receivers - newValueParameters += function.parentAsClass.thisReceiver!!.copyTo( - this, index = newValueParameters.size, name = Name.identifier("arg${newValueParameters.size}"), - type = function.parentAsClass.defaultType, origin = IrDeclarationOrigin.MOVED_DISPATCH_RECEIVER - ) - } - if (function.contextReceiverParametersCount != 0) { - function.valueParameters.take(function.contextReceiverParametersCount).forEachIndexed { i, contextReceiver -> - newValueParameters += contextReceiver.copyTo( - this, index = newValueParameters.size, name = Name.identifier("contextReceiver$i"), - origin = IrDeclarationOrigin.MOVED_CONTEXT_RECEIVER - ) - } - } - function.extensionReceiverParameter?.let { - newValueParameters += it.copyTo( - this, index = newValueParameters.size, name = Name.identifier(function.extensionReceiverName(context.state)), - origin = IrDeclarationOrigin.MOVED_EXTENSION_RECEIVER - ) - } - for (parameter in function.valueParameters.drop(function.contextReceiverParametersCount)) { - newValueParameters += parameter.copyTo(this, index = newValueParameters.size, defaultValue = null).also { - // See comment next to a similar line above. - it.defaultValue = parameter.defaultValue?.patchDeclarationParents(this) - } - } - valueParameters = newValueParameters - } - - private fun buildReplacement( - function: IrFunction, - replacementOrigin: IrDeclarationOrigin, - noFakeOverride: Boolean = false, - body: IrFunction.() -> Unit - ): IrSimpleFunction { - val useOldManglingScheme = context.state.useOldManglingSchemeForFunctionsWithInlineClassesInSignatures - val replacement = buildReplacementInner(function, replacementOrigin, noFakeOverride, useOldManglingScheme, body) - // When using the new mangling scheme we might run into dependencies using the old scheme - // for which we will fall back to the old mangling scheme as well. - if ( - !useOldManglingScheme && - replacement.name.asString().contains("-") && - function.parentClassId?.let { classFileContainsMethod(it, replacement, context) } == false - ) { - return buildReplacementInner(function, replacementOrigin, noFakeOverride, true, body) - } - return replacement - } - - private fun buildReplacementInner( - function: IrFunction, - replacementOrigin: IrDeclarationOrigin, - noFakeOverride: Boolean, - useOldManglingScheme: Boolean, - body: IrFunction.() -> Unit, - ): IrSimpleFunction = irFactory.buildFun { - updateFrom(function) - if (function is IrConstructor) { - // The [updateFrom] call will set the modality to FINAL for constructors, while the JVM backend would use OPEN here. - modality = Modality.OPEN - } - origin = when { - function.origin == IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER -> - JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD - function is IrConstructor && function.constructedClass.isSingleFieldValueClass -> - JvmLoweredDeclarationOrigin.STATIC_INLINE_CLASS_CONSTRUCTOR - else -> - replacementOrigin - } - if (noFakeOverride) { - isFakeOverride = false - } - name = InlineClassAbi.mangledNameFor(function, mangleReturnTypes, useOldManglingScheme) - returnType = function.returnType - }.apply { - parent = function.parent - annotations = function.annotations - copyTypeParameters(function.allTypeParameters) - if (function.metadata != null) { - metadata = function.metadata - function.metadata = null - } - copyAttributes(function as? IrAttributeContainer) - - if (function is IrSimpleFunction) { - val propertySymbol = function.correspondingPropertySymbol - if (propertySymbol != null) { - val property = propertyMap.getOrPut(propertySymbol) { - irFactory.buildProperty { - name = propertySymbol.owner.name - updateFrom(propertySymbol.owner) - }.apply { - parent = propertySymbol.owner.parent - copyAttributes(propertySymbol.owner) - annotations = propertySymbol.owner.annotations - backingField = propertySymbol.owner.backingField - } - } - correspondingPropertySymbol = property.symbol - when (function) { - propertySymbol.owner.getter -> property.getter = this - propertySymbol.owner.setter -> property.setter = this - else -> error("Orphaned property getter/setter: ${function.render()}") - } - } - - overriddenSymbols = function.overriddenSymbols.map { - getReplacementFunction(it.owner)?.symbol ?: it - } - } - - body() + TODO() } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedValueClassAbstractReplacements.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedValueClassAbstractReplacements.kt index 8ddb711a38d..a1dba80c3c1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedValueClassAbstractReplacements.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/MemoizedValueClassAbstractReplacements.kt @@ -14,4 +14,7 @@ abstract class MemoizedValueClassAbstractReplacements(protected val irFactory: I * Get a replacement for a function or a constructor. */ abstract val getReplacementFunction: (IrFunction) -> IrSimpleFunction? + + abstract val originalFunctionForStaticReplacement: MutableMap + } \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt index f3f1cc3a3dd..3689fdd58b0 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt @@ -106,12 +106,11 @@ class ClassGenerator( generateFakeOverrideMemberDeclarations(irClass, ktClassOrObject) + irClass.valueClassRepresentation = classDescriptor.valueClassRepresentation?.mapUnderlyingType { type -> + type.toIrType() as? IrSimpleType ?: error("Value class underlying type is not a simple type: $classDescriptor") + } + if (irClass.isSingleFieldValueClass && ktClassOrObject is KtClassOrObject) { - val representation = classDescriptor.inlineClassRepresentation - ?: error("Unknown representation for inline class: $classDescriptor") - irClass.inlineClassRepresentation = representation.mapUnderlyingType { type -> - type.toIrType() as? IrSimpleType ?: error("Inline class underlying type is not a simple type: $classDescriptor") - } generateAdditionalMembersForSingleFieldValueClasses(irClass, ktClassOrObject) } @@ -164,7 +163,11 @@ class ClassGenerator( context.extensions.getParentClassStaticScope(classDescriptor)?.run { for (parentStaticMember in getContributedDescriptors()) { if (parentStaticMember is FunctionDescriptor && - DescriptorVisibilityUtils.isVisibleIgnoringReceiver(parentStaticMember, classDescriptor, context.languageVersionSettings) + DescriptorVisibilityUtils.isVisibleIgnoringReceiver( + parentStaticMember, + classDescriptor, + context.languageVersionSettings + ) ) { val fakeOverride = createFakeOverrideDescriptorForParentStaticMember(classDescriptor, parentStaticMember) declarationGenerator.generateFakeOverrideDeclaration(fakeOverride, ktClassOrObject)?.let { @@ -523,8 +526,10 @@ class ClassGenerator( if (!enumEntryDescriptor.isExpect) { irEnumEntry.initializerExpression = - context.irFactory.createExpressionBody(createBodyGenerator(irEnumEntry.symbol) - .generateEnumEntryInitializer(ktEnumEntry, enumEntryDescriptor)) + context.irFactory.createExpressionBody( + createBodyGenerator(irEnumEntry.symbol) + .generateEnumEntryInitializer(ktEnumEntry, enumEntryDescriptor) + ) } if (ktEnumEntry.hasMemberDeclarations()) { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StandaloneDeclarationGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StandaloneDeclarationGenerator.kt index 363b1f84f37..90ee82ae087 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StandaloneDeclarationGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StandaloneDeclarationGenerator.kt @@ -97,7 +97,7 @@ class StandaloneDeclarationGenerator(private val context: GeneratorContext) { descriptor.thisAsReceiverParameter.type.toIrType() ).also { it.parent = irClass } - irClass.inlineClassRepresentation = descriptor.inlineClassRepresentation?.mapUnderlyingType { it.toIrType() as IrSimpleType } + irClass.valueClassRepresentation = descriptor.valueClassRepresentation?.mapUnderlyingType { it.toIrType() as IrSimpleType } } return irClass diff --git a/compiler/ir/ir.tree.impl/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt b/compiler/ir/ir.tree.impl/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt index 485d0dc5f94..bd8bcf61f4d 100644 --- a/compiler/ir/ir.tree.impl/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt +++ b/compiler/ir/ir.tree.impl/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt @@ -63,9 +63,7 @@ open class IrClassImpl( override var superTypes: List = emptyList() - override var inlineClassRepresentation: InlineClassRepresentation? = null - - override var multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? = null + override var valueClassRepresentation: ValueClassRepresentation? = null override var metadata: MetadataSource? = null diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt index da2cc53122b..87c0b4b7858 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt @@ -38,9 +38,13 @@ abstract class IrClass : abstract var thisReceiver: IrValueParameter? - abstract var inlineClassRepresentation: InlineClassRepresentation? + abstract var valueClassRepresentation: ValueClassRepresentation? - abstract var multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? + val inlineClassRepresentation: InlineClassRepresentation? + get() = valueClassRepresentation as? InlineClassRepresentation + + val multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? + get() = valueClassRepresentation as? MultiFieldValueClassRepresentation abstract var sealedSubclasses: List diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarations.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarations.kt index 8de7d002239..91aba0aba8c 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarations.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarations.kt @@ -5,10 +5,11 @@ package org.jetbrains.kotlin.ir.declarations +import org.jetbrains.kotlin.descriptors.InlineClassRepresentation +import org.jetbrains.kotlin.descriptors.MultiFieldValueClassRepresentation import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.expressions.IrExpressionBody -import org.jetbrains.kotlin.ir.util.primaryConstructor import java.io.File fun D.copyAttributes(other: IrAttributeContainer?): D = apply { @@ -18,10 +19,10 @@ fun D.copyAttributes(other: IrAttributeContainer?): D } val IrClass.isSingleFieldValueClass: Boolean - get() = this.isValue && (this.inlineClassRepresentation != null || this.primaryConstructor?.valueParameters?.size == 1) + get() = valueClassRepresentation is InlineClassRepresentation val IrClass.isMultiFieldValueClass: Boolean - get() = this.isValue && !isSingleFieldValueClass + get() = valueClassRepresentation is MultiFieldValueClassRepresentation fun IrClass.addMember(member: IrDeclaration) { declarations.add(member) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt index 609b4818c63..9e333190b36 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt @@ -17,7 +17,6 @@ import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.NameResolver import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor -import org.jetbrains.kotlin.types.SimpleType class IrLazyClass( override val startOffset: Int, @@ -101,15 +100,10 @@ class IrLazyClass( } } - override var inlineClassRepresentation: InlineClassRepresentation? by lazyVar(stubGenerator.lock) { - descriptor.inlineClassRepresentation?.mapUnderlyingType(::simplyTypeToIrOrThrow) - } - - private fun simplyTypeToIrOrThrow(it: SimpleType) = - it.toIrType() as? IrSimpleType ?: error("Inline class underlying type is not a simple type: ${render()}") - - override var multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? by lazyVar(stubGenerator.lock) { - descriptor.multiFieldValueClassRepresentation?.mapUnderlyingType(::simplyTypeToIrOrThrow) + override var valueClassRepresentation: ValueClassRepresentation? by lazyVar(stubGenerator.lock) { + descriptor.valueClassRepresentation?.mapUnderlyingType { + it.toIrType() as? IrSimpleType ?: error("Value class underlying type is not a simple type: ${render()}") + } } override var attributeOwnerId: IrAttributeContainer = this diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt index cb89348f9f7..eb0eb3f6b57 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt @@ -30,7 +30,6 @@ import org.jetbrains.kotlin.serialization.deserialization.descriptors.Deserializ import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.* -import org.jetbrains.kotlin.types.typeUtil.makeNullable /* Descriptors that serve purely as a view into IR structures. Created each time at the borderline between IR-based and descriptor-based code (such as inliner). @@ -626,11 +625,8 @@ open class IrBasedClassDescriptor(owner: IrClass) : ClassDescriptor, IrBasedDecl TODO("not implemented") } - override fun getInlineClassRepresentation(): InlineClassRepresentation? = - owner.inlineClassRepresentation?.mapUnderlyingType { it.toIrBasedKotlinType() as SimpleType } - - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = - owner.multiFieldValueClassRepresentation?.mapUnderlyingType { it.toIrBasedKotlinType() as SimpleType } + override fun getValueClassRepresentation(): ValueClassRepresentation? = + owner.valueClassRepresentation?.mapUnderlyingType { it.toIrBasedKotlinType() as SimpleType } override fun getOriginal() = this @@ -756,13 +752,9 @@ open class IrBasedEnumEntryDescriptor(owner: IrEnumEntry) : ClassDescriptor, IrB override fun getDeclaredTypeParameters(): List = emptyList() - override fun getSealedSubclasses(): Collection { - TODO("not implemented") - } + override fun getSealedSubclasses(): Collection = TODO("not implemented") - override fun getInlineClassRepresentation(): InlineClassRepresentation? = TODO("not implemented") - - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = TODO("not implemented") + override fun getValueClassRepresentation(): ValueClassRepresentation? = TODO("not implemented") override fun getOriginal() = this diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt index 29d4d6e82c7..b862b5d3f14 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt @@ -462,6 +462,12 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon override fun TypeConstructorMarker.isInlineClass(): Boolean = (this as? IrClassSymbol)?.owner?.isSingleFieldValueClass == true + override fun TypeConstructorMarker.isMultiFieldValueClass(): Boolean = + (this as? IrClassSymbol)?.owner?.isMultiFieldValueClass == true + + override fun TypeConstructorMarker.valueClassRepresentationTypeMarkersList(): List>? = + (this as? IrClassSymbol)?.owner?.valueClassRepresentation?.underlyingPropertyNamesToTypes + override fun TypeConstructorMarker.isInnerClass(): Boolean = (this as? IrClassSymbol)?.owner?.isInner == true diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt index 4f22b67cffc..57f986e30ef 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal -import org.jetbrains.kotlin.resolve.isInlineOrValueClass +import org.jetbrains.kotlin.resolve.isValueClass import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.utils.addToStdlib.safeAs @@ -269,7 +269,7 @@ abstract class DeclarationStubGenerator( isInner = descriptor.isInner, isData = descriptor.isData, isExternal = descriptor.isEffectivelyExternal(), - isValue = descriptor.isInlineOrValueClass(), + isValue = descriptor.isValueClass(), isExpect = descriptor.isExpect, isFun = descriptor.isFun, stubGenerator = this, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt index 285b29c9a83..2c95e5f7378 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt @@ -159,7 +159,7 @@ open class DeepCopyIrTreeWithSymbols( symbolRemapper.getReferencedClass(it) } thisReceiver = declaration.thisReceiver?.transform() - inlineClassRepresentation = declaration.inlineClassRepresentation?.mapUnderlyingType { it.remapType() as IrSimpleType } + valueClassRepresentation = declaration.valueClassRepresentation?.mapUnderlyingType { it.remapType() as IrSimpleType } declaration.transformDeclarationsTo(this) }.copyAttributes(declaration) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorToIrUtil.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorToIrUtil.kt index 17bf218a8ae..18bfa94b45d 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorToIrUtil.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorToIrUtil.kt @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.ir.declarations.IrFactory import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal -import org.jetbrains.kotlin.resolve.isInlineOrValueClass +import org.jetbrains.kotlin.resolve.isValueClass import org.jetbrains.kotlin.types.KotlinType val ParameterDescriptor.indexOrMinusOne: Int @@ -39,5 +39,5 @@ fun IrFactory.createIrClassFromDescriptor( ): IrClass = createClass( startOffset, endOffset, origin, symbol, name, descriptor.kind, visibility, modality, descriptor.isCompanionObject, descriptor.isInner, descriptor.isData, descriptor.isEffectivelyExternal(), - descriptor.isInlineOrValueClass(), descriptor.isExpect, descriptor.isFun, descriptor.source + descriptor.isValueClass(), descriptor.isExpect, descriptor.isFun, descriptor.source ) diff --git a/compiler/ir/serialization.common/src/KotlinIr.proto b/compiler/ir/serialization.common/src/KotlinIr.proto index e927018d4e3..cdfd26ea6ca 100644 --- a/compiler/ir/serialization.common/src/KotlinIr.proto +++ b/compiler/ir/serialization.common/src/KotlinIr.proto @@ -533,6 +533,7 @@ message IrClass { repeated IrDeclaration declaration = 5; repeated int32 super_type = 6 [packed=true]; optional IrInlineClassRepresentation inline_class_representation = 7; + optional IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; repeated int64 sealed_subclass = 8 [packed=true]; } @@ -621,3 +622,8 @@ message IrInlineClassRepresentation { required int32 underlying_property_name = 1; required int32 underlying_property_type = 2; } + +message IrMultiFieldValueClassRepresentation { + repeated int32 underlying_property_name = 1 [packed=true]; + repeated int32 underlying_property_type = 2 [packed=true]; +} diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt index 45cae8fdc82..7f19e110301 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrType.KindCase.* import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.InlineClassRepresentation import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.MultiFieldValueClassRepresentation import org.jetbrains.kotlin.ir.IrBuiltIns import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.* @@ -23,7 +24,6 @@ import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.symbols.impl.IrPublicSymbolBase -import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterPublicSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.* @@ -48,6 +48,7 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrFunction as Pro import org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionBase as ProtoFunctionBase import org.jetbrains.kotlin.backend.common.serialization.proto.IrInlineClassRepresentation as ProtoIrInlineClassRepresentation import org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty as ProtoLocalDelegatedProperty +import org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation as ProtoIrMultiFieldValueClassRepresentation import org.jetbrains.kotlin.backend.common.serialization.proto.IrProperty as ProtoProperty import org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType as ProtoSimpleType import org.jetbrains.kotlin.backend.common.serialization.proto.IrStatement as ProtoStatement @@ -347,14 +348,16 @@ class IrDeclarationDeserializer( thisReceiver = deserializeIrValueParameter(proto.thisReceiver, -1) - inlineClassRepresentation = when { - !(flags.isValue && primaryConstructor?.valueParameters?.size == 1) -> null + valueClassRepresentation = when { + !flags.isValue -> null + proto.hasMultiFieldValueClassRepresentation() && proto.hasInlineClassRepresentation() -> + error("Class cannot be both inline and multi-field value: $name") proto.hasInlineClassRepresentation() -> deserializeInlineClassRepresentation(proto.inlineClassRepresentation) + proto.hasMultiFieldValueClassRepresentation() -> + deserializeMultiFieldValueClassRepresentation(proto.multiFieldValueClassRepresentation) else -> computeMissingInlineClassRepresentationForCompatibility(this) } - // todo something when value classes - sealedSubclasses = proto.sealedSubclassList.map { deserializeIrSymbol(it) as IrClassSymbol } fakeOverrideBuilder.enqueueClass(this, signature, compatibilityMode) @@ -367,6 +370,12 @@ class IrDeclarationDeserializer( deserializeIrType(proto.underlyingPropertyType) as IrSimpleType, ) + private fun deserializeMultiFieldValueClassRepresentation(proto: ProtoIrMultiFieldValueClassRepresentation): MultiFieldValueClassRepresentation { + val names = proto.underlyingPropertyNameList.map { deserializeName(it) } + val types = proto.underlyingPropertyTypeList.map { deserializeIrType(it) as IrSimpleType } + return MultiFieldValueClassRepresentation(names zip types) + } + private fun computeMissingInlineClassRepresentationForCompatibility(irClass: IrClass): InlineClassRepresentation { // For inline classes compiled with 1.5.20 or earlier, try to reconstruct inline class representation from the single parameter of // the primary constructor. Something similar is happening in `DeserializedClassDescriptor.computeInlineClassRepresentation`. diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt index 839dea45483..66e8b73a8cb 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt @@ -6,10 +6,7 @@ package org.jetbrains.kotlin.backend.common.serialization import org.jetbrains.kotlin.backend.common.serialization.encodings.* -import org.jetbrains.kotlin.descriptors.DeclarationDescriptor -import org.jetbrains.kotlin.descriptors.DescriptorVisibilities -import org.jetbrains.kotlin.descriptors.InlineClassRepresentation -import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor +import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrFileEntry import org.jetbrains.kotlin.ir.declarations.* @@ -83,6 +80,7 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrInlineClassRepr import org.jetbrains.kotlin.backend.common.serialization.proto.IrInstanceInitializerCall as ProtoInstanceInitializerCall import org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty as ProtoLocalDelegatedProperty import org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedPropertyReference as ProtoLocalDelegatedPropertyReference +import org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation as ProtoIrMultiFieldValueClassRepresentation import org.jetbrains.kotlin.backend.common.serialization.proto.IrOperation as ProtoOperation import org.jetbrains.kotlin.backend.common.serialization.proto.IrProperty as ProtoProperty import org.jetbrains.kotlin.backend.common.serialization.proto.IrPropertyReference as ProtoPropertyReference @@ -1031,7 +1029,8 @@ open class IrFileSerializer( is IrGetEnumValue -> operationProto.getEnumValue = serializeGetEnumValue(expression) is IrGetObjectValue -> operationProto.getObject = serializeGetObject(expression) is IrInstanceInitializerCall -> operationProto.instanceInitializerCall = serializeInstanceInitializerCall(expression) - is IrLocalDelegatedPropertyReference -> operationProto.localDelegatedPropertyReference = serializeIrLocalDelegatedPropertyReference(expression) + is IrLocalDelegatedPropertyReference -> operationProto.localDelegatedPropertyReference = + serializeIrLocalDelegatedPropertyReference(expression) is IrPropertyReference -> operationProto.propertyReference = serializePropertyReference(expression) is IrReturn -> serializeReturn(operationProto, expression) is IrSetField -> operationProto.setField = serializeSetField(expression) @@ -1234,9 +1233,12 @@ open class IrFileSerializer( .setBase(serializeIrDeclarationBase(clazz, ClassFlags.encode(clazz))) .setName(serializeName(clazz.name)) - val representation = clazz.inlineClassRepresentation - if (representation != null) { - proto.inlineClassRepresentation = serializeInlineClassRepresentation(representation) + + when (val representation = clazz.valueClassRepresentation) { + is MultiFieldValueClassRepresentation -> + proto.multiFieldValueClassRepresentation = serializeMultiFieldValueClassRepresentation(representation) + is InlineClassRepresentation -> proto.inlineClassRepresentation = serializeInlineClassRepresentation(representation) + null -> Unit } clazz.declarations.forEach { @@ -1267,6 +1269,12 @@ open class IrFileSerializer( underlyingPropertyType = serializeIrType(representation.underlyingType) }.build() + private fun serializeMultiFieldValueClassRepresentation(representation: MultiFieldValueClassRepresentation): ProtoIrMultiFieldValueClassRepresentation = + ProtoIrMultiFieldValueClassRepresentation.newBuilder().apply { + addAllUnderlyingPropertyName(representation.underlyingPropertyNamesToTypes.map { (name, _) -> serializeName(name) }) + addAllUnderlyingPropertyType(representation.underlyingPropertyNamesToTypes.map { (_, irType) -> serializeIrType(irType) }) + }.build() + private fun serializeIrTypeAlias(typeAlias: IrTypeAlias): ProtoTypeAlias { val proto = ProtoTypeAlias.newBuilder() diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClass.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClass.java index efc10421ed0..a43346dcb6c 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClass.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClass.java @@ -135,9 +135,9 @@ public final class IrClass extends break; } case 64: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { sealedSubclass_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; + mutable_bitField0_ |= 0x00000100; } sealedSubclass_.add(input.readInt64()); break; @@ -145,9 +145,9 @@ public final class IrClass extends case 66: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080) && input.getBytesUntilLimit() > 0) { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100) && input.getBytesUntilLimit() > 0) { sealedSubclass_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; + mutable_bitField0_ |= 0x00000100; } while (input.getBytesUntilLimit() > 0) { sealedSubclass_.add(input.readInt64()); @@ -155,6 +155,19 @@ public final class IrClass extends input.popLimit(limit); break; } + case 74: { + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = multiFieldValueClassRepresentation_.toBuilder(); + } + multiFieldValueClassRepresentation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(multiFieldValueClassRepresentation_); + multiFieldValueClassRepresentation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } } } } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { @@ -172,7 +185,7 @@ public final class IrClass extends if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { superType_ = java.util.Collections.unmodifiableList(superType_); } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { sealedSubclass_ = java.util.Collections.unmodifiableList(sealedSubclass_); } try { @@ -354,6 +367,21 @@ public final class IrClass extends return inlineClassRepresentation_; } + public static final int MULTI_FIELD_VALUE_CLASS_REPRESENTATION_FIELD_NUMBER = 9; + private org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multiFieldValueClassRepresentation_; + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public boolean hasMultiFieldValueClassRepresentation() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { + return multiFieldValueClassRepresentation_; + } + public static final int SEALED_SUBCLASS_FIELD_NUMBER = 8; private java.util.List sealedSubclass_; /** @@ -385,6 +413,7 @@ public final class IrClass extends declaration_ = java.util.Collections.emptyList(); superType_ = java.util.Collections.emptyList(); inlineClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrInlineClassRepresentation.getDefaultInstance(); + multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance(); sealedSubclass_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; @@ -468,6 +497,9 @@ public final class IrClass extends for (int i = 0; i < sealedSubclass_.size(); i++) { output.writeInt64NoTag(sealedSubclass_.get(i)); } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(9, multiFieldValueClassRepresentation_); + } output.writeRawBytes(unknownFields); } @@ -529,6 +561,10 @@ public final class IrClass extends } sealedSubclassMemoizedSerializedSize = dataSize; } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(9, multiFieldValueClassRepresentation_); + } size += unknownFields.size(); memoizedSerializedSize = size; return size; @@ -637,8 +673,10 @@ public final class IrClass extends bitField0_ = (bitField0_ & ~0x00000020); inlineClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrInlineClassRepresentation.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000040); - sealedSubclass_ = java.util.Collections.emptyList(); + multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000080); + sealedSubclass_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); return this; } @@ -693,9 +731,13 @@ public final class IrClass extends to_bitField0_ |= 0x00000008; } result.inlineClassRepresentation_ = inlineClassRepresentation_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000010; + } + result.multiFieldValueClassRepresentation_ = multiFieldValueClassRepresentation_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { sealedSubclass_ = java.util.Collections.unmodifiableList(sealedSubclass_); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); } result.sealedSubclass_ = sealedSubclass_; result.bitField0_ = to_bitField0_; @@ -746,10 +788,13 @@ public final class IrClass extends if (other.hasInlineClassRepresentation()) { mergeInlineClassRepresentation(other.getInlineClassRepresentation()); } + if (other.hasMultiFieldValueClassRepresentation()) { + mergeMultiFieldValueClassRepresentation(other.getMultiFieldValueClassRepresentation()); + } if (!other.sealedSubclass_.isEmpty()) { if (sealedSubclass_.isEmpty()) { sealedSubclass_ = other.sealedSubclass_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); } else { ensureSealedSubclassIsMutable(); sealedSubclass_.addAll(other.sealedSubclass_); @@ -1348,11 +1393,71 @@ public final class IrClass extends return this; } + private org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public boolean hasMultiFieldValueClassRepresentation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { + return multiFieldValueClassRepresentation_; + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public Builder setMultiFieldValueClassRepresentation(org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation value) { + if (value == null) { + throw new NullPointerException(); + } + multiFieldValueClassRepresentation_ = value; + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public Builder setMultiFieldValueClassRepresentation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.Builder builderForValue) { + multiFieldValueClassRepresentation_ = builderForValue.build(); + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public Builder mergeMultiFieldValueClassRepresentation(org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation value) { + if (((bitField0_ & 0x00000080) == 0x00000080) && + multiFieldValueClassRepresentation_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance()) { + multiFieldValueClassRepresentation_ = + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.newBuilder(multiFieldValueClassRepresentation_).mergeFrom(value).buildPartial(); + } else { + multiFieldValueClassRepresentation_ = value; + } + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + public Builder clearMultiFieldValueClassRepresentation() { + multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + private java.util.List sealedSubclass_ = java.util.Collections.emptyList(); private void ensureSealedSubclassIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { sealedSubclass_ = new java.util.ArrayList(sealedSubclass_); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; } } /** @@ -1409,7 +1514,7 @@ public final class IrClass extends */ public Builder clearSealedSubclass() { sealedSubclass_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClassOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClassOrBuilder.java index ab8d84564e7..e10492f5e01 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClassOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrClassOrBuilder.java @@ -84,6 +84,15 @@ public interface IrClassOrBuilder extends */ org.jetbrains.kotlin.backend.common.serialization.proto.IrInlineClassRepresentation getInlineClassRepresentation(); + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + boolean hasMultiFieldValueClassRepresentation(); + /** + * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation multi_field_value_class_representation = 9; + */ + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation(); + /** * repeated int64 sealed_subclass = 8 [packed = true]; */ diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentation.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentation.java new file mode 100644 index 00000000000..9467a125840 --- /dev/null +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentation.java @@ -0,0 +1,575 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: compiler/ir/serialization.common/src/KotlinIr.proto + +package org.jetbrains.kotlin.backend.common.serialization.proto; + +/** + * Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation} + */ +public final class IrMultiFieldValueClassRepresentation extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) + IrMultiFieldValueClassRepresentationOrBuilder { + // Use IrMultiFieldValueClassRepresentation.newBuilder() to construct. + private IrMultiFieldValueClassRepresentation(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private IrMultiFieldValueClassRepresentation(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final IrMultiFieldValueClassRepresentation defaultInstance; + public static IrMultiFieldValueClassRepresentation getDefaultInstance() { + return defaultInstance; + } + + public IrMultiFieldValueClassRepresentation getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private IrMultiFieldValueClassRepresentation( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + underlyingPropertyName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + underlyingPropertyName_.add(input.readInt32()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) { + underlyingPropertyName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + underlyingPropertyName_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 16: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + underlyingPropertyType_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + underlyingPropertyType_.add(input.readInt32()); + break; + } + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { + underlyingPropertyType_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + underlyingPropertyType_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + underlyingPropertyName_ = java.util.Collections.unmodifiableList(underlyingPropertyName_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + underlyingPropertyType_ = java.util.Collections.unmodifiableList(underlyingPropertyType_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public IrMultiFieldValueClassRepresentation parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new IrMultiFieldValueClassRepresentation(input, extensionRegistry); + } + }; + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int UNDERLYING_PROPERTY_NAME_FIELD_NUMBER = 1; + private java.util.List underlyingPropertyName_; + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public java.util.List + getUnderlyingPropertyNameList() { + return underlyingPropertyName_; + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public int getUnderlyingPropertyNameCount() { + return underlyingPropertyName_.size(); + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public int getUnderlyingPropertyName(int index) { + return underlyingPropertyName_.get(index); + } + private int underlyingPropertyNameMemoizedSerializedSize = -1; + + public static final int UNDERLYING_PROPERTY_TYPE_FIELD_NUMBER = 2; + private java.util.List underlyingPropertyType_; + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public java.util.List + getUnderlyingPropertyTypeList() { + return underlyingPropertyType_; + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public int getUnderlyingPropertyTypeCount() { + return underlyingPropertyType_.size(); + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public int getUnderlyingPropertyType(int index) { + return underlyingPropertyType_.get(index); + } + private int underlyingPropertyTypeMemoizedSerializedSize = -1; + + private void initFields() { + underlyingPropertyName_ = java.util.Collections.emptyList(); + underlyingPropertyType_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getUnderlyingPropertyNameList().size() > 0) { + output.writeRawVarint32(10); + output.writeRawVarint32(underlyingPropertyNameMemoizedSerializedSize); + } + for (int i = 0; i < underlyingPropertyName_.size(); i++) { + output.writeInt32NoTag(underlyingPropertyName_.get(i)); + } + if (getUnderlyingPropertyTypeList().size() > 0) { + output.writeRawVarint32(18); + output.writeRawVarint32(underlyingPropertyTypeMemoizedSerializedSize); + } + for (int i = 0; i < underlyingPropertyType_.size(); i++) { + output.writeInt32NoTag(underlyingPropertyType_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < underlyingPropertyName_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(underlyingPropertyName_.get(i)); + } + size += dataSize; + if (!getUnderlyingPropertyNameList().isEmpty()) { + size += 1; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + underlyingPropertyNameMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < underlyingPropertyType_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(underlyingPropertyType_.get(i)); + } + size += dataSize; + if (!getUnderlyingPropertyTypeList().isEmpty()) { + size += 1; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + underlyingPropertyTypeMemoizedSerializedSize = dataSize; + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation} + */ + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentationOrBuilder { + // Construct using org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + underlyingPropertyName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + underlyingPropertyType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation getDefaultInstanceForType() { + return org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance(); + } + + public org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation build() { + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation buildPartial() { + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + underlyingPropertyName_ = java.util.Collections.unmodifiableList(underlyingPropertyName_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.underlyingPropertyName_ = underlyingPropertyName_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + underlyingPropertyType_ = java.util.Collections.unmodifiableList(underlyingPropertyType_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.underlyingPropertyType_ = underlyingPropertyType_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation other) { + if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation.getDefaultInstance()) return this; + if (!other.underlyingPropertyName_.isEmpty()) { + if (underlyingPropertyName_.isEmpty()) { + underlyingPropertyName_ = other.underlyingPropertyName_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUnderlyingPropertyNameIsMutable(); + underlyingPropertyName_.addAll(other.underlyingPropertyName_); + } + + } + if (!other.underlyingPropertyType_.isEmpty()) { + if (underlyingPropertyType_.isEmpty()) { + underlyingPropertyType_ = other.underlyingPropertyType_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnderlyingPropertyTypeIsMutable(); + underlyingPropertyType_.addAll(other.underlyingPropertyType_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List underlyingPropertyName_ = java.util.Collections.emptyList(); + private void ensureUnderlyingPropertyNameIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + underlyingPropertyName_ = new java.util.ArrayList(underlyingPropertyName_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public java.util.List + getUnderlyingPropertyNameList() { + return java.util.Collections.unmodifiableList(underlyingPropertyName_); + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public int getUnderlyingPropertyNameCount() { + return underlyingPropertyName_.size(); + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public int getUnderlyingPropertyName(int index) { + return underlyingPropertyName_.get(index); + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public Builder setUnderlyingPropertyName( + int index, int value) { + ensureUnderlyingPropertyNameIsMutable(); + underlyingPropertyName_.set(index, value); + + return this; + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public Builder addUnderlyingPropertyName(int value) { + ensureUnderlyingPropertyNameIsMutable(); + underlyingPropertyName_.add(value); + + return this; + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public Builder addAllUnderlyingPropertyName( + java.lang.Iterable values) { + ensureUnderlyingPropertyNameIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, underlyingPropertyName_); + + return this; + } + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + public Builder clearUnderlyingPropertyName() { + underlyingPropertyName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + + private java.util.List underlyingPropertyType_ = java.util.Collections.emptyList(); + private void ensureUnderlyingPropertyTypeIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + underlyingPropertyType_ = new java.util.ArrayList(underlyingPropertyType_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public java.util.List + getUnderlyingPropertyTypeList() { + return java.util.Collections.unmodifiableList(underlyingPropertyType_); + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public int getUnderlyingPropertyTypeCount() { + return underlyingPropertyType_.size(); + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public int getUnderlyingPropertyType(int index) { + return underlyingPropertyType_.get(index); + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public Builder setUnderlyingPropertyType( + int index, int value) { + ensureUnderlyingPropertyTypeIsMutable(); + underlyingPropertyType_.set(index, value); + + return this; + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public Builder addUnderlyingPropertyType(int value) { + ensureUnderlyingPropertyTypeIsMutable(); + underlyingPropertyType_.add(value); + + return this; + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public Builder addAllUnderlyingPropertyType( + java.lang.Iterable values) { + ensureUnderlyingPropertyTypeIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, underlyingPropertyType_); + + return this; + } + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + public Builder clearUnderlyingPropertyType() { + underlyingPropertyType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) + } + + static { + defaultInstance = new IrMultiFieldValueClassRepresentation(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) +} diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentationOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentationOrBuilder.java new file mode 100644 index 00000000000..73cdb4ada2d --- /dev/null +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrMultiFieldValueClassRepresentationOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: compiler/ir/serialization.common/src/KotlinIr.proto + +package org.jetbrains.kotlin.backend.common.serialization.proto; + +public interface IrMultiFieldValueClassRepresentationOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.IrMultiFieldValueClassRepresentation) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { + + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + java.util.List getUnderlyingPropertyNameList(); + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + int getUnderlyingPropertyNameCount(); + /** + * repeated int32 underlying_property_name = 1 [packed = true]; + */ + int getUnderlyingPropertyName(int index); + + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + java.util.List getUnderlyingPropertyTypeList(); + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + int getUnderlyingPropertyTypeCount(); + /** + * repeated int32 underlying_property_type = 2 [packed = true]; + */ + int getUnderlyingPropertyType(int index); +} \ No newline at end of file diff --git a/compiler/serialization/src/org/jetbrains/kotlin/serialization/DescriptorSerializer.kt b/compiler/serialization/src/org/jetbrains/kotlin/serialization/DescriptorSerializer.kt index 03fe554646e..8837c8915ff 100644 --- a/compiler/serialization/src/org/jetbrains/kotlin/serialization/DescriptorSerializer.kt +++ b/compiler/serialization/src/org/jetbrains/kotlin/serialization/DescriptorSerializer.kt @@ -31,6 +31,8 @@ import org.jetbrains.kotlin.resolve.constants.EnumValue import org.jetbrains.kotlin.resolve.constants.IntValue import org.jetbrains.kotlin.resolve.constants.NullValue import org.jetbrains.kotlin.resolve.constants.StringValue +import org.jetbrains.kotlin.resolve.descriptorUtil.inlineClassRepresentation +import org.jetbrains.kotlin.resolve.descriptorUtil.multiFieldValueClassRepresentation import org.jetbrains.kotlin.resolve.descriptorUtil.nonSourceAnnotations import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags import org.jetbrains.kotlin.serialization.deserialization.descriptorVisibility @@ -92,7 +94,7 @@ class DescriptorSerializer private constructor( ProtoEnumFlags.modality(classDescriptor.modality), ProtoEnumFlags.classKind(classDescriptor.kind, classDescriptor.isCompanionObject), classDescriptor.isInner, classDescriptor.isData, classDescriptor.isExternal, classDescriptor.isExpect, - classDescriptor.isInlineOrValueClass(), classDescriptor.isFun + classDescriptor.isValueClass(), classDescriptor.isFun ) if (flags != builder.flags) { builder.flags = flags @@ -171,22 +173,31 @@ class DescriptorSerializer private constructor( builder.companionObjectName = getSimpleNameIndex(companionObjectDescriptor.name) } - val representation = classDescriptor.inlineClassRepresentation - if (representation != null) { - builder.inlineClassUnderlyingPropertyName = getSimpleNameIndex(representation.underlyingPropertyName) + classDescriptor.inlineClassRepresentation?.let { inlineClassRepresentation -> + builder.inlineClassUnderlyingPropertyName = getSimpleNameIndex(inlineClassRepresentation.underlyingPropertyName) val property = callableMembers.single { - it is PropertyDescriptor && it.extensionReceiverParameter == null && it.name == representation.underlyingPropertyName + it is PropertyDescriptor && it.extensionReceiverParameter == null && it.name == inlineClassRepresentation.underlyingPropertyName } if (!property.visibility.isPublicAPI) { if (useTypeTable()) { - builder.inlineClassUnderlyingTypeId = typeId(representation.underlyingType) + builder.inlineClassUnderlyingTypeId = typeId(inlineClassRepresentation.underlyingType) } else { - builder.setInlineClassUnderlyingType(type(representation.underlyingType)) + builder.setInlineClassUnderlyingType(type(inlineClassRepresentation.underlyingType)) } } } + classDescriptor.multiFieldValueClassRepresentation?.let { multiFieldValueClassRepresentation -> + val namesToTypes = multiFieldValueClassRepresentation.underlyingPropertyNamesToTypes + builder.addAllMultiFieldValueClassUnderlyingName(namesToTypes.map { (name, _) -> getSimpleNameIndex(name) }) + if (useTypeTable()) { + builder.addAllMultiFieldValueClassUnderlyingTypeId(namesToTypes.map { (_, kotlinType) -> typeId(kotlinType) }) + } else { + builder.addAllMultiFieldValueClassUnderlyingType(namesToTypes.map { (_, kotlinType) -> type(kotlinType).build() }) + } + } + if (versionRequirementTable == null) error("Version requirements must be serialized for classes: $classDescriptor") builder.addAllVersionRequirement(versionRequirementTable.serializeVersionRequirements(classDescriptor)) @@ -513,7 +524,8 @@ class DescriptorSerializer private constructor( val builder = ProtoBuf.TypeAlias.newBuilder() val local = createChildSerializer(descriptor) - val flags = Flags.getTypeAliasFlags(hasAnnotations(descriptor), ProtoEnumFlags.descriptorVisibility(normalizeVisibility(descriptor))) + val flags = + Flags.getTypeAliasFlags(hasAnnotations(descriptor), ProtoEnumFlags.descriptorVisibility(normalizeVisibility(descriptor))) if (flags != builder.flags) { builder.flags = flags } diff --git a/compiler/testData/codegen/box/valueClasses/classFlattening.kt b/compiler/testData/codegen/box/valueClasses/classFlattening.kt index 7ab9d6f0c39..46d2026ed44 100644 --- a/compiler/testData/codegen/box/valueClasses/classFlattening.kt +++ b/compiler/testData/codegen/box/valueClasses/classFlattening.kt @@ -18,4 +18,4 @@ value class GreaterMFVC(val x: SimpleMFVC, val y: IC, val z: SimpleMFVC) fun gmfvc(ic: IC, x: GreaterMFVC, ic1: UInt) = smfvc(ic, x.x, 0U) + ic(x.y) + smfvc(IC(0U), x.z, ic1) -fun box() = "todo" \ No newline at end of file +fun box() = "OK" // todo real test \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclaration.txt b/compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclaration.txt index 7cd1f67783f..bc162762429 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclaration.txt +++ b/compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclaration.txt @@ -44,3 +44,4 @@ public inline object InlineObject { public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclaration.txt b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclaration.txt index a7a6cefa46d..c5a00928f01 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclaration.txt +++ b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclaration.txt @@ -57,3 +57,4 @@ package kotlin { } } } + diff --git a/core/compiler.common/src/org/jetbrains/kotlin/descriptors/InlineClassRepresentation.kt b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/InlineClassRepresentation.kt index cebea35e545..5ad6d11e5ac 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/descriptors/InlineClassRepresentation.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/InlineClassRepresentation.kt @@ -8,10 +8,15 @@ package org.jetbrains.kotlin.descriptors import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.model.SimpleTypeMarker -class InlineClassRepresentation( +class InlineClassRepresentation constructor( val underlyingPropertyName: Name, val underlyingType: Type, -) { - inline fun mapUnderlyingType(transform: (Type) -> Other): InlineClassRepresentation = - InlineClassRepresentation(underlyingPropertyName, transform(underlyingType)) -} +) : ValueClassRepresentation() { + + override val underlyingPropertyNamesToTypes: List> + get() = listOf(underlyingPropertyName to underlyingType) + + override fun containsPropertyWithName(name: Name): Boolean = underlyingPropertyName == name + + override fun propertyTypeByName(name: Name): Type? = underlyingType.takeIf { containsPropertyWithName(name) } +} \ No newline at end of file diff --git a/core/compiler.common/src/org/jetbrains/kotlin/descriptors/MultiFieldValueClassRepresentation.kt b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/MultiFieldValueClassRepresentation.kt index e7e39aea770..9f90302f070 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/descriptors/MultiFieldValueClassRepresentation.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/MultiFieldValueClassRepresentation.kt @@ -9,19 +9,13 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.model.SimpleTypeMarker class MultiFieldValueClassRepresentation( - val underlyingPropertyNamesToTypes: List> -) { - init { - require(underlyingPropertyNamesToTypes.size > 1) { "MultiFieldValueClassRepresentation has at least 2 properties" } - } + override val underlyingPropertyNamesToTypes: List> +) : ValueClassRepresentation() { private val map = underlyingPropertyNamesToTypes.toMap().also { require(it.size == underlyingPropertyNamesToTypes.size) { "Some properties have the same names" } } - fun containsPropertyWithName(name: Name): Boolean = name in map - fun propertyTypeByName(name: Name): Type? = map[name] - - inline fun mapUnderlyingType(transform: (Type) -> Other): MultiFieldValueClassRepresentation = - MultiFieldValueClassRepresentation(underlyingPropertyNamesToTypes.map { (key, value) -> key to transform(value) }) + override fun containsPropertyWithName(name: Name): Boolean = name in map + override fun propertyTypeByName(name: Name): Type? = map[name] } \ No newline at end of file diff --git a/core/compiler.common/src/org/jetbrains/kotlin/descriptors/ValueClassRepresentation.kt b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/ValueClassRepresentation.kt new file mode 100644 index 00000000000..ae689f5b264 --- /dev/null +++ b/core/compiler.common/src/org/jetbrains/kotlin/descriptors/ValueClassRepresentation.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.descriptors + +import org.jetbrains.kotlin.descriptors.ValueClassKind.Inline +import org.jetbrains.kotlin.descriptors.ValueClassKind.MultiField +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.TypeSystemCommonBackendContext +import org.jetbrains.kotlin.types.model.SimpleTypeMarker + +sealed class ValueClassRepresentation { + abstract val underlyingPropertyNamesToTypes: List> + abstract fun containsPropertyWithName(name: Name): Boolean + abstract fun getPropertyTypeByName(name: Name): Type? + + fun mapUnderlyingType(transform: (Type) -> Other): ValueClassRepresentation = when (this) { + is InlineClassRepresentation -> InlineClassRepresentation(underlyingPropertyName, transform(underlyingType)) + is MultiFieldValueClassRepresentation -> + MultiFieldValueClassRepresentation(underlyingPropertyNamesToTypes.map { (name, type) -> name to transform(type) }) + } +} + +enum class ValueClassKind { Inline, MultiField } + +fun TypeSystemCommonBackendContext.valueClassLoweringKind( + fields: List>, +): ValueClassKind = when { + fields.size > 1 -> MultiField + fields.isEmpty() -> error("Value classes cannot have 0 fields") + else -> { + val type = fields.single().second + with(this) { + when { + type.isNullableType() -> Inline + !type.typeConstructor().isMultiFieldValueClass() -> Inline + else -> MultiField + } + } + } +} + +fun createValueClassRepresentation(context: TypeSystemCommonBackendContext, fields: List>) = + when (context.valueClassLoweringKind(fields)) { + Inline -> InlineClassRepresentation(fields[0].first, fields[0].second) + MultiField -> MultiFieldValueClassRepresentation(fields) + } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/types/TypeSystemCommonBackendContext.kt b/core/compiler.common/src/org/jetbrains/kotlin/types/TypeSystemCommonBackendContext.kt index c85a02391ad..afc1abb36b5 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/types/TypeSystemCommonBackendContext.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/types/TypeSystemCommonBackendContext.kt @@ -31,6 +31,8 @@ interface TypeSystemCommonBackendContext : TypeSystemContext { fun KotlinTypeMarker.getAnnotationFirstArgumentValue(fqName: FqName): Any? fun TypeConstructorMarker.isInlineClass(): Boolean + fun TypeConstructorMarker.isMultiFieldValueClass(): Boolean + fun TypeConstructorMarker.valueClassRepresentationTypeMarkersList(): List>? fun TypeConstructorMarker.isInnerClass(): Boolean fun TypeParameterMarker.getRepresentativeUpperBound(): KotlinTypeMarker fun KotlinTypeMarker.getUnsubstitutedUnderlyingType(): KotlinTypeMarker? diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt index 9c8ac1560b8..71cf9ff72f7 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt @@ -196,9 +196,7 @@ class LazyJavaClassDescriptor( emptyList() } - override fun getInlineClassRepresentation(): InlineClassRepresentation? = null - - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = null + override fun getValueClassRepresentation(): ValueClassRepresentation? = null override fun toString() = "Lazy Java class ${this.fqNameUnsafe}" diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt index ba5226590bc..05e60d31805 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt @@ -87,8 +87,7 @@ class FunctionClassDescriptor( override val annotations: Annotations get() = Annotations.EMPTY override fun getSource(): SourceElement = SourceElement.NO_SOURCE override fun getSealedSubclasses() = emptyList() - override fun getInlineClassRepresentation(): InlineClassRepresentation? = null - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = null + override fun getValueClassRepresentation(): ValueClassRepresentation? = null override fun getDeclaredTypeParameters() = parameters diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/ClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/ClassDescriptor.java index 1026e5cc91a..7e5619d3530 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/ClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/ClassDescriptor.java @@ -102,10 +102,7 @@ public interface ClassDescriptor extends ClassifierDescriptorWithTypeParameters, Collection getSealedSubclasses(); @Nullable - InlineClassRepresentation getInlineClassRepresentation(); - - @Nullable - MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation(); + ValueClassRepresentation getValueClassRepresentation(); @NotNull @Override diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt index adcd56a2cca..8a85deb7e23 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt @@ -84,8 +84,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo override fun getUnsubstitutedPrimaryConstructor(): ClassConstructorDescriptor? = null override fun getCompanionObjectDescriptor(): ClassDescriptor? = null override fun getSealedSubclasses(): Collection = emptyList() - override fun getInlineClassRepresentation(): InlineClassRepresentation? = null - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = null + override fun getValueClassRepresentation(): ValueClassRepresentation? = null override fun toString() = "class $name (not found)" } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java index a0f92660ba7..1494c78733a 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java @@ -178,13 +178,7 @@ public class ClassDescriptorImpl extends ClassDescriptorBase { @Nullable @Override - public InlineClassRepresentation getInlineClassRepresentation() { - return null; - } - - @Nullable - @Override - public MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { + public ValueClassRepresentation getValueClassRepresentation() { return null; } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java index b8b5389a675..23dffc44370 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java @@ -195,13 +195,7 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase { @Nullable @Override - public InlineClassRepresentation getInlineClassRepresentation() { - return null; - } - - @Nullable - @Override - public MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { + public ValueClassRepresentation getValueClassRepresentation() { return null; } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java index 6537667083d..e6435797daf 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java @@ -324,30 +324,17 @@ public class LazySubstitutingClassDescriptor extends ModuleAwareClassDescriptor @Nullable @Override - public InlineClassRepresentation getInlineClassRepresentation() { - InlineClassRepresentation representation = original.getInlineClassRepresentation(); - //noinspection ConstantConditions - return representation == null ? null : new InlineClassRepresentation( - representation.getUnderlyingPropertyName(), - substituteSimpleType(representation.getUnderlyingType()) - ); - } - - @Nullable - @Override - public MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - MultiFieldValueClassRepresentation representation = original.getMultiFieldValueClassRepresentation(); + public ValueClassRepresentation getValueClassRepresentation() { + ValueClassRepresentation representation = original.getValueClassRepresentation(); if (representation == null) { return null; } - List> underlyingList = new ArrayList>(representation.getUnderlyingPropertyNamesToTypes()); - for (int i = 0; i < underlyingList.size(); i++) { - Pair pair = underlyingList.get(i); - Name name = pair.getFirst(); - SimpleType simpleType = pair.getSecond(); - underlyingList.set(i, new Pair(name, substituteSimpleType(simpleType))); - } - return new MultiFieldValueClassRepresentation(underlyingList); + return representation.mapUnderlyingType(new Function1() { + @Override + public SimpleType invoke(SimpleType type) { + return substituteSimpleType(type); + } + }); } @Nullable diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java index 0bd7fea7667..6a59c93496a 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java @@ -191,13 +191,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase { @Nullable @Override - public InlineClassRepresentation getInlineClassRepresentation() { - return null; - } - - @Nullable - @Override - public MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { + public ValueClassRepresentation getValueClassRepresentation() { return null; } diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.kt index 705b208b0fb..c71ffc4042e 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/DescriptorUtils.kt @@ -30,7 +30,6 @@ import org.jetbrains.kotlin.types.checker.KotlinTypeChecker import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner import org.jetbrains.kotlin.types.checker.REFINER_CAPABILITY import org.jetbrains.kotlin.types.checker.TypeRefinementSupport -import org.jetbrains.kotlin.types.TypeRefinement import org.jetbrains.kotlin.types.typeUtil.contains import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny import org.jetbrains.kotlin.types.typeUtil.makeNullable @@ -450,3 +449,9 @@ fun D.shouldBeSubstituteWithStubTypes() = && dispatchReceiverParameter?.type?.isError != true && extensionReceiverParameter?.type?.isError != true && containsStubTypes() + +val ClassDescriptor?.inlineClassRepresentation: InlineClassRepresentation? + get() = this?.valueClassRepresentation as? InlineClassRepresentation + +val ClassDescriptor?.multiFieldValueClassRepresentation: MultiFieldValueClassRepresentation? + get() = this?.valueClassRepresentation as? MultiFieldValueClassRepresentation diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/inlineClassesUtils.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/inlineClassesUtils.kt index 7f8812f935d..dba1702e1b4 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/inlineClassesUtils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/inlineClassesUtils.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.resolve import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.resolve.descriptorUtil.inlineClassRepresentation import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeSubstitutor import org.jetbrains.kotlin.types.TypeUtils @@ -19,16 +20,12 @@ val JVM_INLINE_ANNOTATION_CLASS_ID = ClassId.topLevel(JVM_INLINE_ANNOTATION_FQ_N // FIXME: DeserializedClassDescriptor in reflection do not have @JvmInline annotation, that we // FIXME: would like to check as well. -fun DeclarationDescriptor.isInlineClass(): Boolean = when { - this !is ClassDescriptor -> false - isInline -> true - else -> isValue && unsubstitutedPrimaryConstructor?.valueParameters?.size?.let { it == 1 } ?: true -} +fun DeclarationDescriptor.isInlineClass(): Boolean = this is ClassDescriptor && this.valueClassRepresentation is InlineClassRepresentation -fun DeclarationDescriptor.isValueClass(): Boolean = - this is ClassDescriptor && isValue +fun DeclarationDescriptor.isMultiFieldValueClass(): Boolean = + this is ClassDescriptor && this.valueClassRepresentation is MultiFieldValueClassRepresentation -fun DeclarationDescriptor.isInlineOrValueClass(): Boolean = isInlineClass() || isValueClass() +fun DeclarationDescriptor.isValueClass(): Boolean = isInlineClass() || isMultiFieldValueClass() fun KotlinType.unsubstitutedUnderlyingType(): KotlinType? = constructor.declarationDescriptor.safeAs()?.inlineClassRepresentation?.underlyingType @@ -37,7 +34,7 @@ fun KotlinType.unsubstitutedUnderlyingTypes(): List { val declarationDescriptor = constructor.declarationDescriptor.safeAs() ?: return emptyList() return when { declarationDescriptor.isInlineClass() -> listOfNotNull(unsubstitutedUnderlyingType()) - declarationDescriptor.isValueClass() -> + declarationDescriptor.isMultiFieldValueClass() -> declarationDescriptor.unsubstitutedPrimaryConstructor?.valueParameters?.map { it.type } ?: emptyList() else -> emptyList() } @@ -56,8 +53,8 @@ fun KotlinType.isRecursiveInlineOrValueClassType(): Boolean = isRecursiveInlineOrValueClassTypeInner(hashSetOf()) private fun KotlinType.isRecursiveInlineOrValueClassTypeInner(visited: HashSet): Boolean { - val types = when (val descriptor = constructor.declarationDescriptor?.original?.takeIf { it.isInlineOrValueClass() }) { - is ClassDescriptor -> if (descriptor.isInlineOrValueClass()) unsubstitutedUnderlyingTypes() else emptyList() + val types = when (val descriptor = constructor.declarationDescriptor?.original?.takeIf { it.isValueClass() }) { + is ClassDescriptor -> if (descriptor.isValueClass()) unsubstitutedUnderlyingTypes() else emptyList() is TypeParameterDescriptor -> descriptor.upperBounds else -> emptyList() } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt index c6425f21dbd..efb3f2a4018 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.calls.inference.CapturedType import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor import org.jetbrains.kotlin.resolve.descriptorUtil.* -import org.jetbrains.kotlin.resolve.isInlineClass import org.jetbrains.kotlin.resolve.substitutedUnderlyingType import org.jetbrains.kotlin.resolve.unsubstitutedUnderlyingType import org.jetbrains.kotlin.types.* @@ -31,10 +30,10 @@ import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import org.jetbrains.kotlin.utils.addToStdlib.safeAs import org.jetbrains.kotlin.types.typeUtil.isSignedOrUnsignedNumberType as classicIsSignedOrUnsignedNumberType -import org.jetbrains.kotlin.types.typeUtil.isStubTypeForVariableInSubtyping as isSimpleTypeStubTypeForVariableInSubtyping -import org.jetbrains.kotlin.types.typeUtil.isStubTypeForBuilderInference as isSimpleTypeStubTypeForBuilderInference import org.jetbrains.kotlin.types.typeUtil.isStubType as isSimpleTypeStubType +import org.jetbrains.kotlin.types.typeUtil.isStubTypeForBuilderInference as isSimpleTypeStubTypeForBuilderInference import org.jetbrains.kotlin.types.error.ErrorUtils +import org.jetbrains.kotlin.types.typeUtil.isStubTypeForVariableInSubtyping as isSimpleTypeStubTypeForVariableInSubtyping interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSystemCommonBackendContext { override fun TypeConstructorMarker.isDenotable(): Boolean { @@ -742,7 +741,17 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy override fun TypeConstructorMarker.isInlineClass(): Boolean { require(this is TypeConstructor, this::errorMessage) - return (declarationDescriptor as? ClassDescriptor)?.isInlineClass() == true + return (declarationDescriptor as? ClassDescriptor)?.valueClassRepresentation is InlineClassRepresentation + } + + override fun TypeConstructorMarker.isMultiFieldValueClass(): Boolean { + require(this is TypeConstructor, this::errorMessage) + return (declarationDescriptor as? ClassDescriptor)?.valueClassRepresentation is MultiFieldValueClassRepresentation + } + + override fun TypeConstructorMarker.valueClassRepresentationTypeMarkersList(): List>? { + require(this is TypeConstructor, this::errorMessage) + return (declarationDescriptor as? ClassDescriptor)?.valueClassRepresentation?.underlyingPropertyNamesToTypes } override fun TypeConstructorMarker.isInnerClass(): Boolean { diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt index 5c2170db18a..35f01da232b 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt @@ -17,7 +17,10 @@ import org.jetbrains.kotlin.incremental.record import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.* import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.resolve.* +import org.jetbrains.kotlin.resolve.CliSealedClassInheritorsProvider +import org.jetbrains.kotlin.resolve.DescriptorFactory +import org.jetbrains.kotlin.resolve.NonReportingOverrideStrategy +import org.jetbrains.kotlin.resolve.OverridingUtil import org.jetbrains.kotlin.resolve.descriptorUtil.classId import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.MemberScope @@ -68,9 +71,7 @@ class DeserializedClassDescriptor( private val constructors = c.storageManager.createLazyValue { computeConstructors() } private val companionObjectDescriptor = c.storageManager.createNullableLazyValue { computeCompanionObjectDescriptor() } private val sealedSubclasses = c.storageManager.createLazyValue { computeSubclassesForSealedClass() } - private val inlineClassRepresentation = c.storageManager.createNullableLazyValue { computeInlineClassRepresentation() } - private val multiFieldValueClassRepresentation = - c.storageManager.createNullableLazyValue { computeMultiFieldValueClassRepresentation() } + private val valueClassRepresentation = c.storageManager.createNullableLazyValue { computeValueClassRepresentation() } internal val thisAsProtoContainer: ProtoContainer.Class = ProtoContainer.Class( classProto, c.nameResolver, c.typeTable, sourceElement, @@ -182,12 +183,28 @@ class DeserializedClassDescriptor( override fun getSealedSubclasses() = sealedSubclasses() - override fun getInlineClassRepresentation(): InlineClassRepresentation? = inlineClassRepresentation() - override fun getMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? = - multiFieldValueClassRepresentation() + override fun getValueClassRepresentation(): ValueClassRepresentation? = valueClassRepresentation() + + private fun computeValueClassRepresentation(): ValueClassRepresentation? { + val inlineClassRepresentation = computeInlineClassRepresentation() + val multiFieldValueClassRepresentation = computeMultiFieldValueClassRepresentation() + return when { + inlineClassRepresentation != null && multiFieldValueClassRepresentation != null -> + throw IllegalArgumentException("Class cannot have both inline class representation and multi field class representation: $this") + (isValue || isInline) && inlineClassRepresentation == null && multiFieldValueClassRepresentation == null -> + throw IllegalArgumentException("Value class has no value class representation: $this") + else -> inlineClassRepresentation ?: multiFieldValueClassRepresentation + } + } private fun computeInlineClassRepresentation(): InlineClassRepresentation? { - if (!isInlineClass()) return null + if (!isInline && !isValue) return null + if (isValue && + !classProto.hasInlineClassUnderlyingPropertyName() && + !classProto.hasInlineClassUnderlyingType() && + !classProto.hasInlineClassUnderlyingTypeId() && + classProto.multiFieldValueClassUnderlyingNameCount > 0 + ) return null val propertyName = when { classProto.hasInlineClassUnderlyingPropertyName() -> @@ -201,34 +218,27 @@ class DeserializedClassDescriptor( else -> error("Inline class has no underlying property name in metadata: $this") } - val type = classProto.inlineClassUnderlyingType(c.typeTable)?.let(c.typeDeserializer::simpleType) - ?: getPropertyTypeFromContributedVariables(propertyName) + val type = classProto.inlineClassUnderlyingType(c.typeTable)?.let(c.typeDeserializer::simpleType) ?: run { + val underlyingProperty = memberScope.getContributedVariables(propertyName, NoLookupLocation.FROM_DESERIALIZATION) + .singleOrNull { it.extensionReceiverParameter == null } ?: error("Value class has no underlying property: $this") + underlyingProperty.type as SimpleType + } return InlineClassRepresentation(propertyName, type) } - private fun getPropertyTypeFromContributedVariables(propertyName: Name): SimpleType { - val underlyingProperty = memberScope.getContributedVariables(propertyName, NoLookupLocation.FROM_DESERIALIZATION) - .singleOrNull { it.extensionReceiverParameter == null } ?: error("Value class has no underlying property: $this") - return underlyingProperty.type as SimpleType - } - private fun computeMultiFieldValueClassRepresentation(): MultiFieldValueClassRepresentation? { - if (!isValueClass() || isInlineClass()) return null - val representation = classProto.multiFieldValueClassRepresentation - ?: error("No multiFieldValueClassRepresentation for multi-field value class: $this") - val propertyList = representation.propertyList.map { valueClassProperty -> - val name: Name = c.nameResolver.getName(valueClassProperty.name) - val protoType: ProtoBuf.Type = when { - valueClassProperty.hasType() -> valueClassProperty.type - valueClassProperty.hasTypeId() -> c.typeTable[valueClassProperty.typeId] - else -> error("Unlike inline classes before 1.5.0, multi-field value classes always have intermediate representation") - } - name to c.typeDeserializer.simpleType(protoType) - } - require(propertyList.size > 1) - require(propertyList.distinctBy { (name, _) -> name }.size == propertyList.size) - return MultiFieldValueClassRepresentation(propertyList) + val names = classProto.multiFieldValueClassUnderlyingNameList.map { c.nameResolver.getName(it) }.takeIf { it.isNotEmpty() } + ?: return null + require(isValue) { "Not a value class: $this" } + val typeIdCount = classProto.multiFieldValueClassUnderlyingTypeIdCount + val typeCount = classProto.multiFieldValueClassUnderlyingTypeCount + val types = when (typeIdCount to typeCount) { + names.size to 0 -> classProto.multiFieldValueClassUnderlyingTypeIdList.map { c.typeTable[it] } + 0 to names.size -> classProto.multiFieldValueClassUnderlyingTypeList + else -> error("Illegal multi-field value class representation: $this") + }.map { c.typeDeserializer.simpleType(it) } + return MultiFieldValueClassRepresentation(names zip types) } override fun toString() = @@ -283,7 +293,7 @@ class DeserializedClassDescriptor( private inner class DeserializedClassMemberScope(private val kotlinTypeRefiner: KotlinTypeRefiner) : DeserializedMemberScope( c, classProto.functionList, classProto.propertyList, classProto.typeAliasList, - classProto.nestedClassNameList.map(c.nameResolver::getName).let { list -> { list } } // workaround KT-13454 + classProto.nestedClassNameList.map(c.nameResolver::getName).let { { it } } // workaround KT-13454 ) { private val classDescriptor: DeserializedClassDescriptor get() = this@DeserializedClassDescriptor diff --git a/core/metadata/src/metadata.proto b/core/metadata/src/metadata.proto index 5cd0aee00c8..11445e45f0a 100644 --- a/core/metadata/src/metadata.proto +++ b/core/metadata/src/metadata.proto @@ -242,18 +242,9 @@ message Class { optional Type inline_class_underlying_type = 18; optional int32 inline_class_underlying_type_id = 19 [(type_id_in_table) = true]; - message MultiFieldValueClassRepresentation { - message MultiFieldValueClassProperty { - required int32 name = 1; - oneof type_representation { - Type type = 2; - int32 type_id = 3; - } - } - repeated MultiFieldValueClassProperty property = 1; - } - - optional MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + repeated int32 multi_field_value_class_underlying_name = 22 [packed = true, (name_id_in_table) = true]; + repeated Type multi_field_value_class_underlying_type = 23; + repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true, (type_id_in_table) = true]; optional TypeTable type_table = 30; diff --git a/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java b/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java index 22ab7a37a23..5e446071ded 100644 --- a/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java +++ b/core/metadata/src/org/jetbrains/kotlin/metadata/ProtoBuf.java @@ -8513,13 +8513,44 @@ public final class ProtoBuf { int getInlineClassUnderlyingTypeId(); /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - boolean hasMultiFieldValueClassRepresentation(); + java.util.List getMultiFieldValueClassUnderlyingNameList(); /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation(); + int getMultiFieldValueClassUnderlyingNameCount(); + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + int getMultiFieldValueClassUnderlyingName(int index); + + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + java.util.List + getMultiFieldValueClassUnderlyingTypeList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + int getMultiFieldValueClassUnderlyingTypeCount(); + + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + java.util.List getMultiFieldValueClassUnderlyingTypeIdList(); + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + int getMultiFieldValueClassUnderlyingTypeIdCount(); + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + int getMultiFieldValueClassUnderlyingTypeId(int index); /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -8801,22 +8832,59 @@ public final class ProtoBuf { input.popLimit(limit); break; } + case 176: { + if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00040000; + } + multiFieldValueClassUnderlyingName_.add(input.readInt32()); + break; + } case 178: { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.Builder subBuilder = null; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - subBuilder = multiFieldValueClassRepresentation_.toBuilder(); + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00040000) == 0x00040000) && input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00040000; } - multiFieldValueClassRepresentation_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(multiFieldValueClassRepresentation_); - multiFieldValueClassRepresentation_ = subBuilder.buildPartial(); + while (input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingName_.add(input.readInt32()); } - bitField0_ |= 0x00000040; + input.popLimit(limit); + break; + } + case 186: { + if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00080000; + } + multiFieldValueClassUnderlyingType_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + break; + } + case 192: { + if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00100000; + } + multiFieldValueClassUnderlyingTypeId_.add(input.readInt32()); + break; + } + case 194: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00100000) == 0x00100000) && input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00100000; + } + while (input.getBytesUntilLimit() > 0) { + multiFieldValueClassUnderlyingTypeId_.add(input.readInt32()); + } + input.popLimit(limit); break; } case 242: { org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { subBuilder = typeTable_.toBuilder(); } typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); @@ -8824,13 +8892,13 @@ public final class ProtoBuf { subBuilder.mergeFrom(typeTable_); typeTable_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; break; } case 248: { - if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + if (!((mutable_bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00100000; + mutable_bitField0_ |= 0x00400000; } versionRequirement_.add(input.readInt32()); break; @@ -8838,9 +8906,9 @@ public final class ProtoBuf { case 250: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00100000) == 0x00100000) && input.getBytesUntilLimit() > 0) { + if (!((mutable_bitField0_ & 0x00400000) == 0x00400000) && input.getBytesUntilLimit() > 0) { versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00100000; + mutable_bitField0_ |= 0x00400000; } while (input.getBytesUntilLimit() > 0) { versionRequirement_.add(input.readInt32()); @@ -8850,7 +8918,7 @@ public final class ProtoBuf { } case 258: { org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = versionRequirementTable_.toBuilder(); } versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); @@ -8858,7 +8926,7 @@ public final class ProtoBuf { subBuilder.mergeFrom(versionRequirementTable_); versionRequirementTable_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000080; break; } } @@ -8905,7 +8973,16 @@ public final class ProtoBuf { if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { contextReceiverTypeId_ = java.util.Collections.unmodifiableList(contextReceiverTypeId_); } + if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); + } + if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + } if (((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); + } + if (((mutable_bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); } try { @@ -9042,1124 +9119,6 @@ public final class ProtoBuf { // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Class.Kind) } - public interface MultiFieldValueClassRepresentationOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - java.util.List - getPropertyList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - int getPropertyCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation} - */ - public static final class MultiFieldValueClassRepresentation extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - MultiFieldValueClassRepresentationOrBuilder { - // Use MultiFieldValueClassRepresentation.newBuilder() to construct. - private MultiFieldValueClassRepresentation(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private MultiFieldValueClassRepresentation(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - - private static final MultiFieldValueClassRepresentation defaultInstance; - public static MultiFieldValueClassRepresentation getDefaultInstance() { - return defaultInstance; - } - - public MultiFieldValueClassRepresentation getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private MultiFieldValueClassRepresentation( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = - org.jetbrains.kotlin.protobuf.ByteString.newOutput(); - org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = - org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - property_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - property_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.PARSER, extensionRegistry)); - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - property_ = java.util.Collections.unmodifiableList(property_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public MultiFieldValueClassRepresentation parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new MultiFieldValueClassRepresentation(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - public interface MultiFieldValueClassPropertyOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { - - /** - * required int32 name = 1; - */ - boolean hasName(); - /** - * required int32 name = 1; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - boolean hasType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); - - /** - * optional int32 type_id = 3; - */ - boolean hasTypeId(); - /** - * optional int32 type_id = 3; - */ - int getTypeId(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty} - */ - public static final class MultiFieldValueClassProperty extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - MultiFieldValueClassPropertyOrBuilder { - // Use MultiFieldValueClassProperty.newBuilder() to construct. - private MultiFieldValueClassProperty(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private MultiFieldValueClassProperty(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - - private static final MultiFieldValueClassProperty defaultInstance; - public static MultiFieldValueClassProperty getDefaultInstance() { - return defaultInstance; - } - - public MultiFieldValueClassProperty getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private MultiFieldValueClassProperty( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = - org.jetbrains.kotlin.protobuf.ByteString.newOutput(); - org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = - org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } - case 18: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (typeRepresentationCase_ == 2) { - subBuilder = ((org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_).toBuilder(); - } - typeRepresentation_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_); - typeRepresentation_ = subBuilder.buildPartial(); - } - typeRepresentationCase_ = 2; - break; - } - case 24: { - typeRepresentationCase_ = 3; - typeRepresentation_ = input.readInt32(); - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public MultiFieldValueClassProperty parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new MultiFieldValueClassProperty(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - private int typeRepresentationCase_ = 0; - private java.lang.Object typeRepresentation_; - public enum TypeRepresentationCase - implements org.jetbrains.kotlin.protobuf.Internal.EnumLite { - TYPE(2), - TYPE_ID(3), - TYPEREPRESENTATION_NOT_SET(0); - private int value = 0; - private TypeRepresentationCase(int value) { - this.value = value; - } - public static TypeRepresentationCase valueOf(int value) { - switch (value) { - case 2: return TYPE; - case 3: return TYPE_ID; - case 0: return TYPEREPRESENTATION_NOT_SET; - default: throw new java.lang.IllegalArgumentException( - "Value is undefined for this oneof enum."); - } - } - public int getNumber() { - return this.value; - } - }; - - public TypeRepresentationCase - getTypeRepresentationCase() { - return TypeRepresentationCase.valueOf( - typeRepresentationCase_); - } - - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * required int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name = 1; - */ - public int getName() { - return name_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public boolean hasType() { - return typeRepresentationCase_ == 2; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { - if (typeRepresentationCase_ == 2) { - return (org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_; - } - return org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - } - - public static final int TYPE_ID_FIELD_NUMBER = 3; - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return typeRepresentationCase_ == 3; - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - if (typeRepresentationCase_ == 3) { - return (java.lang.Integer) typeRepresentation_; - } - return 0; - } - - private void initFields() { - name_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); - } - if (typeRepresentationCase_ == 2) { - output.writeMessage(2, (org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_); - } - if (typeRepresentationCase_ == 3) { - output.writeInt32( - 3, (int)((java.lang.Integer) typeRepresentation_)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(1, name_); - } - if (typeRepresentationCase_ == 2) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, (org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_); - } - if (typeRepresentationCase_ == 3) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size( - 3, (int)((java.lang.Integer) typeRepresentation_)); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - typeRepresentationCase_ = 0; - typeRepresentation_ = null; - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty result = new org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (typeRepresentationCase_ == 2) { - result.typeRepresentation_ = typeRepresentation_; - } - if (typeRepresentationCase_ == 3) { - result.typeRepresentation_ = typeRepresentation_; - } - result.bitField0_ = to_bitField0_; - result.typeRepresentationCase_ = typeRepresentationCase_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - switch (other.getTypeRepresentationCase()) { - case TYPE: { - mergeType(other.getType()); - break; - } - case TYPE_ID: { - setTypeId(other.getTypeId()); - break; - } - case TYPEREPRESENTATION_NOT_SET: { - break; - } - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int typeRepresentationCase_ = 0; - private java.lang.Object typeRepresentation_; - public TypeRepresentationCase - getTypeRepresentationCase() { - return TypeRepresentationCase.valueOf( - typeRepresentationCase_); - } - - public Builder clearTypeRepresentation() { - typeRepresentationCase_ = 0; - typeRepresentation_ = null; - return this; - } - - private int bitField0_; - - private int name_ ; - /** - * required int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name = 1; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 1; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; - - return this; - } - /** - * required int32 name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - - return this; - } - - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public boolean hasType() { - return typeRepresentationCase_ == 2; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { - if (typeRepresentationCase_ == 2) { - return (org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_; - } - return org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - typeRepresentation_ = value; - - typeRepresentationCase_ = 2; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder setType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - typeRepresentation_ = builderForValue.build(); - - typeRepresentationCase_ = 2; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (typeRepresentationCase_ == 2 && - typeRepresentation_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - typeRepresentation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder((org.jetbrains.kotlin.metadata.ProtoBuf.Type) typeRepresentation_) - .mergeFrom(value).buildPartial(); - } else { - typeRepresentation_ = value; - } - - typeRepresentationCase_ = 2; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - */ - public Builder clearType() { - if (typeRepresentationCase_ == 2) { - typeRepresentationCase_ = 0; - typeRepresentation_ = null; - - } - return this; - } - - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return typeRepresentationCase_ == 3; - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - if (typeRepresentationCase_ == 3) { - return (java.lang.Integer) typeRepresentation_; - } - return 0; - } - /** - * optional int32 type_id = 3; - */ - public Builder setTypeId(int value) { - typeRepresentationCase_ = 3; - typeRepresentation_ = value; - - return this; - } - /** - * optional int32 type_id = 3; - */ - public Builder clearTypeId() { - if (typeRepresentationCase_ == 3) { - typeRepresentationCase_ = 0; - typeRepresentation_ = null; - - } - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - } - - static { - defaultInstance = new MultiFieldValueClassProperty(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty) - } - - public static final int PROPERTY_FIELD_NUMBER = 1; - private java.util.List property_; - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List getPropertyList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List - getPropertyOrBuilderList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassPropertyOrBuilder getPropertyOrBuilder( - int index) { - return property_.get(index); - } - - private void initFields() { - property_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < property_.size(); i++) { - output.writeMessage(1, property_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < property_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, property_.get(i)); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentationOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation result = new org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - property_ = java.util.Collections.unmodifiableList(property_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.property_ = property_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance()) return this; - if (!other.property_.isEmpty()) { - if (property_.isEmpty()) { - property_ = other.property_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePropertyIsMutable(); - property_.addAll(other.property_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List property_ = - java.util.Collections.emptyList(); - private void ensurePropertyIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - property_ = new java.util.ArrayList(property_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public java.util.List getPropertyList() { - return java.util.Collections.unmodifiableList(property_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder addAllProperty( - java.lang.Iterable values) { - ensurePropertyIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, property_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder clearProperty() { - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation.MultiFieldValueClassProperty property = 1; - */ - public Builder removeProperty(int index) { - ensurePropertyIsMutable(); - property_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - } - - static { - defaultInstance = new MultiFieldValueClassRepresentation(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation) - } - private int bitField0_; public static final int FLAGS_FIELD_NUMBER = 1; private int flags_; @@ -10649,20 +9608,86 @@ public final class ProtoBuf { return inlineClassUnderlyingTypeId_; } - public static final int MULTI_FIELD_VALUE_CLASS_REPRESENTATION_FIELD_NUMBER = 22; - private org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation multiFieldValueClassRepresentation_; + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_FIELD_NUMBER = 22; + private java.util.List multiFieldValueClassUnderlyingName_; /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public boolean hasMultiFieldValueClassRepresentation() { - return ((bitField0_ & 0x00000040) == 0x00000040); + public java.util.List + getMultiFieldValueClassUnderlyingNameList() { + return multiFieldValueClassUnderlyingName_; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - return multiFieldValueClassRepresentation_; + public int getMultiFieldValueClassUnderlyingNameCount() { + return multiFieldValueClassUnderlyingName_.size(); } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingName(int index) { + return multiFieldValueClassUnderlyingName_.get(index); + } + private int multiFieldValueClassUnderlyingNameMemoizedSerializedSize = -1; + + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 23; + private java.util.List multiFieldValueClassUnderlyingType_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List getMultiFieldValueClassUnderlyingTypeList() { + return multiFieldValueClassUnderlyingType_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeOrBuilderList() { + return multiFieldValueClassUnderlyingType_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public int getMultiFieldValueClassUnderlyingTypeCount() { + return multiFieldValueClassUnderlyingType_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index) { + return multiFieldValueClassUnderlyingType_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getMultiFieldValueClassUnderlyingTypeOrBuilder( + int index) { + return multiFieldValueClassUnderlyingType_.get(index); + } + + public static final int MULTI_FIELD_VALUE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 24; + private java.util.List multiFieldValueClassUnderlyingTypeId_; + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeIdList() { + return multiFieldValueClassUnderlyingTypeId_; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeIdCount() { + return multiFieldValueClassUnderlyingTypeId_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeId(int index) { + return multiFieldValueClassUnderlyingTypeId_.get(index); + } + private int multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize = -1; public static final int TYPE_TABLE_FIELD_NUMBER = 30; private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; @@ -10670,7 +9695,7 @@ public final class ProtoBuf { * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public boolean hasTypeTable() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -10719,7 +9744,7 @@ public final class ProtoBuf { * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000080) == 0x00000080); } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; @@ -10747,7 +9772,9 @@ public final class ProtoBuf { inlineClassUnderlyingPropertyName_ = 0; inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); inlineClassUnderlyingTypeId_ = 0; - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); versionRequirement_ = java.util.Collections.emptyList(); versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); @@ -10816,8 +9843,8 @@ public final class ProtoBuf { return false; } } - if (hasMultiFieldValueClassRepresentation()) { - if (!getMultiFieldValueClassRepresentation().isInitialized()) { + for (int i = 0; i < getMultiFieldValueClassUnderlyingTypeCount(); i++) { + if (!getMultiFieldValueClassUnderlyingType(i).isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -10912,16 +9939,30 @@ public final class ProtoBuf { for (int i = 0; i < contextReceiverTypeId_.size(); i++) { output.writeInt32NoTag(contextReceiverTypeId_.get(i)); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeMessage(22, multiFieldValueClassRepresentation_); + if (getMultiFieldValueClassUnderlyingNameList().size() > 0) { + output.writeRawVarint32(178); + output.writeRawVarint32(multiFieldValueClassUnderlyingNameMemoizedSerializedSize); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + for (int i = 0; i < multiFieldValueClassUnderlyingName_.size(); i++) { + output.writeInt32NoTag(multiFieldValueClassUnderlyingName_.get(i)); + } + for (int i = 0; i < multiFieldValueClassUnderlyingType_.size(); i++) { + output.writeMessage(23, multiFieldValueClassUnderlyingType_.get(i)); + } + if (getMultiFieldValueClassUnderlyingTypeIdList().size() > 0) { + output.writeRawVarint32(194); + output.writeRawVarint32(multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize); + } + for (int i = 0; i < multiFieldValueClassUnderlyingTypeId_.size(); i++) { + output.writeInt32NoTag(multiFieldValueClassUnderlyingTypeId_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeMessage(30, typeTable_); } for (int i = 0; i < versionRequirement_.size(); i++) { output.writeInt32(31, versionRequirement_.get(i)); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeMessage(32, versionRequirementTable_); } extensionWriter.writeUntil(19000, output); @@ -11046,11 +10087,39 @@ public final class ProtoBuf { } contextReceiverTypeIdMemoizedSerializedSize = dataSize; } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(22, multiFieldValueClassRepresentation_); + { + int dataSize = 0; + for (int i = 0; i < multiFieldValueClassUnderlyingName_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(multiFieldValueClassUnderlyingName_.get(i)); + } + size += dataSize; + if (!getMultiFieldValueClassUnderlyingNameList().isEmpty()) { + size += 2; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + multiFieldValueClassUnderlyingNameMemoizedSerializedSize = dataSize; } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + for (int i = 0; i < multiFieldValueClassUnderlyingType_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(23, multiFieldValueClassUnderlyingType_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < multiFieldValueClassUnderlyingTypeId_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(multiFieldValueClassUnderlyingTypeId_.get(i)); + } + size += dataSize; + if (!getMultiFieldValueClassUnderlyingTypeIdList().isEmpty()) { + size += 2; + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + multiFieldValueClassUnderlyingTypeIdMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(30, typeTable_); } @@ -11063,7 +10132,7 @@ public final class ProtoBuf { size += dataSize; size += 2 * getVersionRequirementList().size(); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(32, versionRequirementTable_); } @@ -11197,14 +10266,18 @@ public final class ProtoBuf { bitField0_ = (bitField0_ & ~0x00010000); inlineClassUnderlyingTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00020000); - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00040000); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00080000); - versionRequirement_ = java.util.Collections.emptyList(); + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00100000); - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00200000); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00400000); + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00800000); return this; } @@ -11312,21 +10385,32 @@ public final class ProtoBuf { to_bitField0_ |= 0x00000020; } result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_; - if (((from_bitField0_ & 0x00040000) == 0x00040000)) { - to_bitField0_ |= 0x00000040; + if (((bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); + bitField0_ = (bitField0_ & ~0x00040000); } - result.multiFieldValueClassRepresentation_ = multiFieldValueClassRepresentation_; - if (((from_bitField0_ & 0x00080000) == 0x00080000)) { - to_bitField0_ |= 0x00000080; + result.multiFieldValueClassUnderlyingName_ = multiFieldValueClassUnderlyingName_; + if (((bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + bitField0_ = (bitField0_ & ~0x00080000); } - result.typeTable_ = typeTable_; + result.multiFieldValueClassUnderlyingType_ = multiFieldValueClassUnderlyingType_; if (((bitField0_ & 0x00100000) == 0x00100000)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); bitField0_ = (bitField0_ & ~0x00100000); } - result.versionRequirement_ = versionRequirement_; + result.multiFieldValueClassUnderlyingTypeId_ = multiFieldValueClassUnderlyingTypeId_; if (((from_bitField0_ & 0x00200000) == 0x00200000)) { - to_bitField0_ |= 0x00000100; + to_bitField0_ |= 0x00000040; + } + result.typeTable_ = typeTable_; + if (((bitField0_ & 0x00400000) == 0x00400000)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00400000); + } + result.versionRequirement_ = versionRequirement_; + if (((from_bitField0_ & 0x00800000) == 0x00800000)) { + to_bitField0_ |= 0x00000080; } result.versionRequirementTable_ = versionRequirementTable_; result.bitField0_ = to_bitField0_; @@ -11473,8 +10557,35 @@ public final class ProtoBuf { if (other.hasInlineClassUnderlyingTypeId()) { setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId()); } - if (other.hasMultiFieldValueClassRepresentation()) { - mergeMultiFieldValueClassRepresentation(other.getMultiFieldValueClassRepresentation()); + if (!other.multiFieldValueClassUnderlyingName_.isEmpty()) { + if (multiFieldValueClassUnderlyingName_.isEmpty()) { + multiFieldValueClassUnderlyingName_ = other.multiFieldValueClassUnderlyingName_; + bitField0_ = (bitField0_ & ~0x00040000); + } else { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.addAll(other.multiFieldValueClassUnderlyingName_); + } + + } + if (!other.multiFieldValueClassUnderlyingType_.isEmpty()) { + if (multiFieldValueClassUnderlyingType_.isEmpty()) { + multiFieldValueClassUnderlyingType_ = other.multiFieldValueClassUnderlyingType_; + bitField0_ = (bitField0_ & ~0x00080000); + } else { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.addAll(other.multiFieldValueClassUnderlyingType_); + } + + } + if (!other.multiFieldValueClassUnderlyingTypeId_.isEmpty()) { + if (multiFieldValueClassUnderlyingTypeId_.isEmpty()) { + multiFieldValueClassUnderlyingTypeId_ = other.multiFieldValueClassUnderlyingTypeId_; + bitField0_ = (bitField0_ & ~0x00100000); + } else { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.addAll(other.multiFieldValueClassUnderlyingTypeId_); + } + } if (other.hasTypeTable()) { mergeTypeTable(other.getTypeTable()); @@ -11482,7 +10593,7 @@ public final class ProtoBuf { if (!other.versionRequirement_.isEmpty()) { if (versionRequirement_.isEmpty()) { versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); } else { ensureVersionRequirementIsMutable(); versionRequirement_.addAll(other.versionRequirement_); @@ -11557,8 +10668,8 @@ public final class ProtoBuf { return false; } } - if (hasMultiFieldValueClassRepresentation()) { - if (!getMultiFieldValueClassRepresentation().isInitialized()) { + for (int i = 0; i < getMultiFieldValueClassUnderlyingTypeCount(); i++) { + if (!getMultiFieldValueClassUnderlyingType(i).isInitialized()) { return false; } @@ -13131,63 +12242,260 @@ public final class ProtoBuf { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; - */ - public boolean hasMultiFieldValueClassRepresentation() { - return ((bitField0_ & 0x00040000) == 0x00040000); + private java.util.List multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingNameIsMutable() { + if (!((bitField0_ & 0x00040000) == 0x00040000)) { + multiFieldValueClassUnderlyingName_ = new java.util.ArrayList(multiFieldValueClassUnderlyingName_); + bitField0_ |= 0x00040000; + } } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation getMultiFieldValueClassRepresentation() { - return multiFieldValueClassRepresentation_; + public java.util.List + getMultiFieldValueClassUnderlyingNameList() { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingName_); } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; */ - public Builder setMultiFieldValueClassRepresentation(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation value) { + public int getMultiFieldValueClassUnderlyingNameCount() { + return multiFieldValueClassUnderlyingName_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingName(int index) { + return multiFieldValueClassUnderlyingName_.get(index); + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder setMultiFieldValueClassUnderlyingName( + int index, int value) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.set(index, value); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder addMultiFieldValueClassUnderlyingName(int value) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + multiFieldValueClassUnderlyingName_.add(value); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder addAllMultiFieldValueClassUnderlyingName( + java.lang.Iterable values) { + ensureMultiFieldValueClassUnderlyingNameIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingName_); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_name = 22 [packed = true]; + */ + public Builder clearMultiFieldValueClassUnderlyingName() { + multiFieldValueClassUnderlyingName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00040000); + + return this; + } + + private java.util.List multiFieldValueClassUnderlyingType_ = + java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingTypeIsMutable() { + if (!((bitField0_ & 0x00080000) == 0x00080000)) { + multiFieldValueClassUnderlyingType_ = new java.util.ArrayList(multiFieldValueClassUnderlyingType_); + bitField0_ |= 0x00080000; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public java.util.List getMultiFieldValueClassUnderlyingTypeList() { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingType_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public int getMultiFieldValueClassUnderlyingTypeCount() { + return multiFieldValueClassUnderlyingType_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getMultiFieldValueClassUnderlyingType(int index) { + return multiFieldValueClassUnderlyingType_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder setMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } - multiFieldValueClassRepresentation_ = value; + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.set(index, value); - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder setMultiFieldValueClassRepresentation( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.Builder builderForValue) { - multiFieldValueClassRepresentation_ = builderForValue.build(); + public Builder setMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.set(index, builderForValue.build()); - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder mergeMultiFieldValueClassRepresentation(org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation value) { - if (((bitField0_ & 0x00040000) == 0x00040000) && - multiFieldValueClassRepresentation_ != org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance()) { - multiFieldValueClassRepresentation_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.newBuilder(multiFieldValueClassRepresentation_).mergeFrom(value).buildPartial(); - } else { - multiFieldValueClassRepresentation_ = value; + public Builder addMultiFieldValueClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); } + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(value); - bitField0_ |= 0x00040000; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Class.MultiFieldValueClassRepresentation multi_field_value_class_representation = 22; + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; */ - public Builder clearMultiFieldValueClassRepresentation() { - multiFieldValueClassRepresentation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Class.MultiFieldValueClassRepresentation.getDefaultInstance(); + public Builder addMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(index, value); - bitField0_ = (bitField0_ & ~0x00040000); + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder addMultiFieldValueClassUnderlyingType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder addMultiFieldValueClassUnderlyingType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder addAllMultiFieldValueClassUnderlyingType( + java.lang.Iterable values) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingType_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder clearMultiFieldValueClassUnderlyingType() { + multiFieldValueClassUnderlyingType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00080000); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type multi_field_value_class_underlying_type = 23; + */ + public Builder removeMultiFieldValueClassUnderlyingType(int index) { + ensureMultiFieldValueClassUnderlyingTypeIsMutable(); + multiFieldValueClassUnderlyingType_.remove(index); + + return this; + } + + private java.util.List multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); + private void ensureMultiFieldValueClassUnderlyingTypeIdIsMutable() { + if (!((bitField0_ & 0x00100000) == 0x00100000)) { + multiFieldValueClassUnderlyingTypeId_ = new java.util.ArrayList(multiFieldValueClassUnderlyingTypeId_); + bitField0_ |= 0x00100000; + } + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public java.util.List + getMultiFieldValueClassUnderlyingTypeIdList() { + return java.util.Collections.unmodifiableList(multiFieldValueClassUnderlyingTypeId_); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeIdCount() { + return multiFieldValueClassUnderlyingTypeId_.size(); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public int getMultiFieldValueClassUnderlyingTypeId(int index) { + return multiFieldValueClassUnderlyingTypeId_.get(index); + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder setMultiFieldValueClassUnderlyingTypeId( + int index, int value) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.set(index, value); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder addMultiFieldValueClassUnderlyingTypeId(int value) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + multiFieldValueClassUnderlyingTypeId_.add(value); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder addAllMultiFieldValueClassUnderlyingTypeId( + java.lang.Iterable values) { + ensureMultiFieldValueClassUnderlyingTypeIdIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, multiFieldValueClassUnderlyingTypeId_); + + return this; + } + /** + * repeated int32 multi_field_value_class_underlying_type_id = 24 [packed = true]; + */ + public Builder clearMultiFieldValueClassUnderlyingTypeId() { + multiFieldValueClassUnderlyingTypeId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00100000); + return this; } @@ -13196,7 +12504,7 @@ public final class ProtoBuf { * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public boolean hasTypeTable() { - return ((bitField0_ & 0x00080000) == 0x00080000); + return ((bitField0_ & 0x00200000) == 0x00200000); } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; @@ -13213,7 +12521,7 @@ public final class ProtoBuf { } typeTable_ = value; - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** @@ -13223,14 +12531,14 @@ public final class ProtoBuf { org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { typeTable_ = builderForValue.build(); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { - if (((bitField0_ & 0x00080000) == 0x00080000) && + if (((bitField0_ & 0x00200000) == 0x00200000) && typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); @@ -13238,7 +12546,7 @@ public final class ProtoBuf { typeTable_ = value; } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; return this; } /** @@ -13247,15 +12555,15 @@ public final class ProtoBuf { public Builder clearTypeTable() { typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); return this; } private java.util.List versionRequirement_ = java.util.Collections.emptyList(); private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00100000) == 0x00100000)) { + if (!((bitField0_ & 0x00400000) == 0x00400000)) { versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00400000; } } /** @@ -13340,7 +12648,7 @@ public final class ProtoBuf { */ public Builder clearVersionRequirement() { versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00400000); return this; } @@ -13350,7 +12658,7 @@ public final class ProtoBuf { * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00200000) == 0x00200000); + return ((bitField0_ & 0x00800000) == 0x00800000); } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; @@ -13367,7 +12675,7 @@ public final class ProtoBuf { } versionRequirementTable_ = value; - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** @@ -13377,14 +12685,14 @@ public final class ProtoBuf { org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder builderForValue) { versionRequirementTable_ = builderForValue.build(); - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** * optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32; */ public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { - if (((bitField0_ & 0x00200000) == 0x00200000) && + if (((bitField0_ & 0x00800000) == 0x00800000) && versionRequirementTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) { versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); @@ -13392,7 +12700,7 @@ public final class ProtoBuf { versionRequirementTable_ = value; } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; return this; } /** @@ -13401,7 +12709,7 @@ public final class ProtoBuf { public Builder clearVersionRequirementTable() { versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00800000); return this; } diff --git a/plugins/parcelize/parcelize-compiler/src/org/jetbrains/kotlin/parcelize/ir/AndroidSymbols.kt b/plugins/parcelize/parcelize-compiler/src/org/jetbrains/kotlin/parcelize/ir/AndroidSymbols.kt index 7ba7b0465dd..79e45be7c58 100644 --- a/plugins/parcelize/parcelize-compiler/src/org/jetbrains/kotlin/parcelize/ir/AndroidSymbols.kt +++ b/plugins/parcelize/parcelize-compiler/src/org/jetbrains/kotlin/parcelize/ir/AndroidSymbols.kt @@ -109,27 +109,27 @@ class AndroidSymbols( val kotlinUByte: IrClassSymbol = createClass(kotlin, "UByte", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.byteType as IrSimpleType) + owner.valueClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.byteType as IrSimpleType) } val kotlinUShort: IrClassSymbol = createClass(kotlin, "UShort", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.shortType as IrSimpleType) + owner.valueClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.shortType as IrSimpleType) } val kotlinUInt: IrClassSymbol = createClass(kotlin, "UInt", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.intType as IrSimpleType) + owner.valueClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.intType as IrSimpleType) } val kotlinULong: IrClassSymbol = createClass(kotlin, "ULong", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.longType as IrSimpleType) + owner.valueClassRepresentation = InlineClassRepresentation(Name.identifier("data"), irBuiltIns.longType as IrSimpleType) } val kotlinUByteArray: IrClassSymbol = createClass(kotlin, "UByteArray", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation( + owner.valueClassRepresentation = InlineClassRepresentation( Name.identifier("storage"), irBuiltIns.primitiveArrayForType.getValue(irBuiltIns.byteType).owner.defaultType ) @@ -137,7 +137,7 @@ class AndroidSymbols( val kotlinUShortArray: IrClassSymbol = createClass(kotlin, "UShortArray", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation( + owner.valueClassRepresentation = InlineClassRepresentation( Name.identifier("storage"), irBuiltIns.primitiveArrayForType.getValue(irBuiltIns.shortType).owner.defaultType ) @@ -145,7 +145,7 @@ class AndroidSymbols( val kotlinUIntArray: IrClassSymbol = createClass(kotlin, "UIntArray", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation( + owner.valueClassRepresentation = InlineClassRepresentation( Name.identifier("storage"), irBuiltIns.primitiveArrayForType.getValue(irBuiltIns.intType).owner.defaultType ) @@ -153,7 +153,7 @@ class AndroidSymbols( val kotlinULongArray: IrClassSymbol = createClass(kotlin, "ULongArray", ClassKind.CLASS, Modality.FINAL, true).apply { - owner.inlineClassRepresentation = InlineClassRepresentation( + owner.valueClassRepresentation = InlineClassRepresentation( Name.identifier("storage"), irBuiltIns.primitiveArrayForType.getValue(irBuiltIns.longType).owner.defaultType )