Write/load subclasses of sealed classes in metadata

Note that now DeserializedClassDescriptor.getSealedSubclasses works a lot
faster than before, for all newly compiled sealed classes except empty ones. It
may be optimized further if we look at the metadata version of the file the
class was loaded from, however it's not easy currently because
DeserializedClassDescriptor is declared in common (non-JVM) code and has no
direct access to the binary version information.

This will also allow to add a reflection API to get subclasses of a sealed
class

 #KT-12795 Fixed
This commit is contained in:
Alexander Udalov
2016-12-30 18:33:36 +03:00
parent 75a4958144
commit 7107ee2eeb
9 changed files with 540 additions and 126 deletions
@@ -125,6 +125,8 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassEnumEntry(old, new)) return false if (!checkEqualsClassEnumEntry(old, new)) return false
if (!checkEqualsClassSealedSubclassFqName(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false if (old.hasTypeTable() != new.hasTypeTable()) return false
if (old.hasTypeTable()) { if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) return false if (!checkEquals(old.typeTable, new.typeTable)) return false
@@ -160,6 +162,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
PROPERTY_LIST, PROPERTY_LIST,
TYPE_ALIAS_LIST, TYPE_ALIAS_LIST,
ENUM_ENTRY_LIST, ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
TYPE_TABLE, TYPE_TABLE,
SINCE_KOTLIN_INFO, SINCE_KOTLIN_INFO,
SINCE_KOTLIN_INFO_TABLE, SINCE_KOTLIN_INFO_TABLE,
@@ -199,6 +202,8 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsClassEnumEntry(old, new)) result.add(ProtoBufClassKind.ENUM_ENTRY_LIST) if (!checkEqualsClassEnumEntry(old, new)) result.add(ProtoBufClassKind.ENUM_ENTRY_LIST)
if (!checkEqualsClassSealedSubclassFqName(old, new)) result.add(ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufClassKind.TYPE_TABLE) if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufClassKind.TYPE_TABLE)
if (old.hasTypeTable()) { if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE) if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
@@ -850,6 +855,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true return true
} }
open fun checkEqualsClassSealedSubclassFqName(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.sealedSubclassFqNameCount != new.sealedSubclassFqNameCount) return false
for(i in 0..old.sealedSubclassFqNameCount - 1) {
if (!checkClassIdEquals(old.getSealedSubclassFqName(i), new.getSealedSubclassFqName(i))) return false
}
return true
}
open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean { open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1090,6 +1105,10 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + getEnumEntry(i).hashCode(stringIndexes, fqNameIndexes) hashCode = 31 * hashCode + getEnumEntry(i).hashCode(stringIndexes, fqNameIndexes)
} }
for(i in 0..sealedSubclassFqNameCount - 1) {
hashCode = 31 * hashCode + fqNameIndexes(getSealedSubclassFqName(i))
}
if (hasTypeTable()) { if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes) hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
} }
@@ -217,6 +217,9 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
ProtoBufClassKind.ENUM_ENTRY_LIST -> { ProtoBufClassKind.ENUM_ENTRY_LIST -> {
isClassAffected = true isClassAffected = true
} }
ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST -> {
// TODO
}
ProtoBufClassKind.TYPE_TABLE -> { ProtoBufClassKind.TYPE_TABLE -> {
// TODO // TODO
} }
@@ -9972,6 +9972,19 @@ public final class DebugProtoBuf {
org.jetbrains.kotlin.serialization.DebugProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder( org.jetbrains.kotlin.serialization.DebugProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder(
int index); int index);
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
java.util.List<java.lang.Integer> getSealedSubclassFqNameList();
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
int getSealedSubclassFqNameCount();
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
int getSealedSubclassFqName(int index);
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
@@ -10181,6 +10194,27 @@ public final class DebugProtoBuf {
enumEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.DebugProtoBuf.EnumEntry.PARSER, extensionRegistry)); enumEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.DebugProtoBuf.EnumEntry.PARSER, extensionRegistry));
break; break;
} }
case 128: {
if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00001000;
}
sealedSubclassFqName_.add(input.readInt32());
break;
}
case 130: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00001000) == 0x00001000) && input.getBytesUntilLimit() > 0) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00001000;
}
while (input.getBytesUntilLimit() > 0) {
sealedSubclassFqName_.add(input.readInt32());
}
input.popLimit(limit);
break;
}
case 242: { case 242: {
org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder subBuilder = null; org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
@@ -10247,6 +10281,9 @@ public final class DebugProtoBuf {
if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_);
} }
if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
}
this.unknownFields = unknownFields.build(); this.unknownFields = unknownFields.build();
makeExtensionsImmutable(); makeExtensionsImmutable();
} }
@@ -10768,6 +10805,29 @@ public final class DebugProtoBuf {
return enumEntry_.get(index); return enumEntry_.get(index);
} }
public static final int SEALED_SUBCLASS_FQ_NAME_FIELD_NUMBER = 16;
private java.util.List<java.lang.Integer> sealedSubclassFqName_;
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public java.util.List<java.lang.Integer>
getSealedSubclassFqNameList() {
return sealedSubclassFqName_;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqNameCount() {
return sealedSubclassFqName_.size();
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqName(int index) {
return sealedSubclassFqName_.get(index);
}
private int sealedSubclassFqNameMemoizedSerializedSize = -1;
public static final int TYPE_TABLE_FIELD_NUMBER = 30; public static final int TYPE_TABLE_FIELD_NUMBER = 30;
private org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable typeTable_; private org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable typeTable_;
/** /**
@@ -10846,6 +10906,7 @@ public final class DebugProtoBuf {
property_ = java.util.Collections.emptyList(); property_ = java.util.Collections.emptyList();
typeAlias_ = java.util.Collections.emptyList(); typeAlias_ = java.util.Collections.emptyList();
enumEntry_ = java.util.Collections.emptyList(); enumEntry_ = java.util.Collections.emptyList();
sealedSubclassFqName_ = java.util.Collections.emptyList();
typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance(); typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance();
sinceKotlinInfo_ = 0; sinceKotlinInfo_ = 0;
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance(); sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance();
@@ -10966,6 +11027,13 @@ public final class DebugProtoBuf {
for (int i = 0; i < enumEntry_.size(); i++) { for (int i = 0; i < enumEntry_.size(); i++) {
output.writeMessage(13, enumEntry_.get(i)); output.writeMessage(13, enumEntry_.get(i));
} }
if (getSealedSubclassFqNameList().size() > 0) {
output.writeRawVarint32(130);
output.writeRawVarint32(sealedSubclassFqNameMemoizedSerializedSize);
}
for (int i = 0; i < sealedSubclassFqName_.size(); i++) {
output.writeInt32NoTag(sealedSubclassFqName_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(30, typeTable_); output.writeMessage(30, typeTable_);
} }
@@ -11053,6 +11121,20 @@ public final class DebugProtoBuf {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(13, enumEntry_.get(i)); .computeMessageSize(13, enumEntry_.get(i));
} }
{
int dataSize = 0;
for (int i = 0; i < sealedSubclassFqName_.size(); i++) {
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(sealedSubclassFqName_.get(i));
}
size += dataSize;
if (!getSealedSubclassFqNameList().isEmpty()) {
size += 2;
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
sealedSubclassFqNameMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(30, typeTable_); .computeMessageSize(30, typeTable_);
@@ -11245,20 +11327,22 @@ public final class DebugProtoBuf {
} else { } else {
enumEntryBuilder_.clear(); enumEntryBuilder_.clear();
} }
sealedSubclassFqName_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00001000);
if (typeTableBuilder_ == null) { if (typeTableBuilder_ == null) {
typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance(); typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance();
} else { } else {
typeTableBuilder_.clear(); typeTableBuilder_.clear();
} }
bitField0_ = (bitField0_ & ~0x00001000);
sinceKotlinInfo_ = 0;
bitField0_ = (bitField0_ & ~0x00002000); bitField0_ = (bitField0_ & ~0x00002000);
sinceKotlinInfo_ = 0;
bitField0_ = (bitField0_ & ~0x00004000);
if (sinceKotlinInfoTableBuilder_ == null) { if (sinceKotlinInfoTableBuilder_ == null) {
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance(); sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance();
} else { } else {
sinceKotlinInfoTableBuilder_.clear(); sinceKotlinInfoTableBuilder_.clear();
} }
bitField0_ = (bitField0_ & ~0x00004000); bitField0_ = (bitField0_ & ~0x00008000);
return this; return this;
} }
@@ -11372,7 +11456,12 @@ public final class DebugProtoBuf {
} else { } else {
result.enumEntry_ = enumEntryBuilder_.build(); result.enumEntry_ = enumEntryBuilder_.build();
} }
if (((from_bitField0_ & 0x00001000) == 0x00001000)) { if (((bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
bitField0_ = (bitField0_ & ~0x00001000);
}
result.sealedSubclassFqName_ = sealedSubclassFqName_;
if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
to_bitField0_ |= 0x00000008; to_bitField0_ |= 0x00000008;
} }
if (typeTableBuilder_ == null) { if (typeTableBuilder_ == null) {
@@ -11380,11 +11469,11 @@ public final class DebugProtoBuf {
} else { } else {
result.typeTable_ = typeTableBuilder_.build(); result.typeTable_ = typeTableBuilder_.build();
} }
if (((from_bitField0_ & 0x00002000) == 0x00002000)) { if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
to_bitField0_ |= 0x00000010; to_bitField0_ |= 0x00000010;
} }
result.sinceKotlinInfo_ = sinceKotlinInfo_; result.sinceKotlinInfo_ = sinceKotlinInfo_;
if (((from_bitField0_ & 0x00004000) == 0x00004000)) { if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
to_bitField0_ |= 0x00000020; to_bitField0_ |= 0x00000020;
} }
if (sinceKotlinInfoTableBuilder_ == null) { if (sinceKotlinInfoTableBuilder_ == null) {
@@ -11619,6 +11708,16 @@ public final class DebugProtoBuf {
} }
} }
} }
if (!other.sealedSubclassFqName_.isEmpty()) {
if (sealedSubclassFqName_.isEmpty()) {
sealedSubclassFqName_ = other.sealedSubclassFqName_;
bitField0_ = (bitField0_ & ~0x00001000);
} else {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.addAll(other.sealedSubclassFqName_);
}
onChanged();
}
if (other.hasTypeTable()) { if (other.hasTypeTable()) {
mergeTypeTable(other.getTypeTable()); mergeTypeTable(other.getTypeTable());
} }
@@ -13656,6 +13755,72 @@ public final class DebugProtoBuf {
return enumEntryBuilder_; return enumEntryBuilder_;
} }
private java.util.List<java.lang.Integer> sealedSubclassFqName_ = java.util.Collections.emptyList();
private void ensureSealedSubclassFqNameIsMutable() {
if (!((bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>(sealedSubclassFqName_);
bitField0_ |= 0x00001000;
}
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public java.util.List<java.lang.Integer>
getSealedSubclassFqNameList() {
return java.util.Collections.unmodifiableList(sealedSubclassFqName_);
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqNameCount() {
return sealedSubclassFqName_.size();
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqName(int index) {
return sealedSubclassFqName_.get(index);
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder setSealedSubclassFqName(
int index, int value) {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder addSealedSubclassFqName(int value) {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.add(value);
onChanged();
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder addAllSealedSubclassFqName(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensureSealedSubclassFqNameIsMutable();
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, sealedSubclassFqName_);
onChanged();
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder clearSealedSubclassFqName() {
sealedSubclassFqName_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00001000);
onChanged();
return this;
}
private org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance(); private org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance();
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder< private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable, org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder, org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTableOrBuilder> typeTableBuilder_; org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable, org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder, org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTableOrBuilder> typeTableBuilder_;
@@ -13663,7 +13828,7 @@ public final class DebugProtoBuf {
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
public boolean hasTypeTable() { public boolean hasTypeTable() {
return ((bitField0_ & 0x00001000) == 0x00001000); return ((bitField0_ & 0x00002000) == 0x00002000);
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
@@ -13688,7 +13853,7 @@ public final class DebugProtoBuf {
} else { } else {
typeTableBuilder_.setMessage(value); typeTableBuilder_.setMessage(value);
} }
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
@@ -13702,7 +13867,7 @@ public final class DebugProtoBuf {
} else { } else {
typeTableBuilder_.setMessage(builderForValue.build()); typeTableBuilder_.setMessage(builderForValue.build());
} }
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
@@ -13710,7 +13875,7 @@ public final class DebugProtoBuf {
*/ */
public Builder mergeTypeTable(org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable value) { public Builder mergeTypeTable(org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable value) {
if (typeTableBuilder_ == null) { if (typeTableBuilder_ == null) {
if (((bitField0_ & 0x00001000) == 0x00001000) && if (((bitField0_ & 0x00002000) == 0x00002000) &&
typeTable_ != org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ != org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.getDefaultInstance()) {
typeTable_ = typeTable_ =
org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial();
@@ -13721,7 +13886,7 @@ public final class DebugProtoBuf {
} else { } else {
typeTableBuilder_.mergeFrom(value); typeTableBuilder_.mergeFrom(value);
} }
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
@@ -13734,14 +13899,14 @@ public final class DebugProtoBuf {
} else { } else {
typeTableBuilder_.clear(); typeTableBuilder_.clear();
} }
bitField0_ = (bitField0_ & ~0x00001000); bitField0_ = (bitField0_ & ~0x00002000);
return this; return this;
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
public org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder getTypeTableBuilder() { public org.jetbrains.kotlin.serialization.DebugProtoBuf.TypeTable.Builder getTypeTableBuilder() {
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
onChanged(); onChanged();
return getTypeTableFieldBuilder().getBuilder(); return getTypeTableFieldBuilder().getBuilder();
} }
@@ -13781,7 +13946,7 @@ public final class DebugProtoBuf {
* </pre> * </pre>
*/ */
public boolean hasSinceKotlinInfo() { public boolean hasSinceKotlinInfo() {
return ((bitField0_ & 0x00002000) == 0x00002000); return ((bitField0_ & 0x00004000) == 0x00004000);
} }
/** /**
* <code>optional int32 sinceKotlinInfo = 31;</code> * <code>optional int32 sinceKotlinInfo = 31;</code>
@@ -13801,7 +13966,7 @@ public final class DebugProtoBuf {
* </pre> * </pre>
*/ */
public Builder setSinceKotlinInfo(int value) { public Builder setSinceKotlinInfo(int value) {
bitField0_ |= 0x00002000; bitField0_ |= 0x00004000;
sinceKotlinInfo_ = value; sinceKotlinInfo_ = value;
onChanged(); onChanged();
return this; return this;
@@ -13814,7 +13979,7 @@ public final class DebugProtoBuf {
* </pre> * </pre>
*/ */
public Builder clearSinceKotlinInfo() { public Builder clearSinceKotlinInfo() {
bitField0_ = (bitField0_ & ~0x00002000); bitField0_ = (bitField0_ & ~0x00004000);
sinceKotlinInfo_ = 0; sinceKotlinInfo_ = 0;
onChanged(); onChanged();
return this; return this;
@@ -13827,7 +13992,7 @@ public final class DebugProtoBuf {
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
*/ */
public boolean hasSinceKotlinInfoTable() { public boolean hasSinceKotlinInfoTable() {
return ((bitField0_ & 0x00004000) == 0x00004000); return ((bitField0_ & 0x00008000) == 0x00008000);
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
@@ -13852,7 +14017,7 @@ public final class DebugProtoBuf {
} else { } else {
sinceKotlinInfoTableBuilder_.setMessage(value); sinceKotlinInfoTableBuilder_.setMessage(value);
} }
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
@@ -13866,7 +14031,7 @@ public final class DebugProtoBuf {
} else { } else {
sinceKotlinInfoTableBuilder_.setMessage(builderForValue.build()); sinceKotlinInfoTableBuilder_.setMessage(builderForValue.build());
} }
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
@@ -13874,7 +14039,7 @@ public final class DebugProtoBuf {
*/ */
public Builder mergeSinceKotlinInfoTable(org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable value) { public Builder mergeSinceKotlinInfoTable(org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable value) {
if (sinceKotlinInfoTableBuilder_ == null) { if (sinceKotlinInfoTableBuilder_ == null) {
if (((bitField0_ & 0x00004000) == 0x00004000) && if (((bitField0_ & 0x00008000) == 0x00008000) &&
sinceKotlinInfoTable_ != org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance()) { sinceKotlinInfoTable_ != org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.getDefaultInstance()) {
sinceKotlinInfoTable_ = sinceKotlinInfoTable_ =
org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.newBuilder(sinceKotlinInfoTable_).mergeFrom(value).buildPartial(); org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.newBuilder(sinceKotlinInfoTable_).mergeFrom(value).buildPartial();
@@ -13885,7 +14050,7 @@ public final class DebugProtoBuf {
} else { } else {
sinceKotlinInfoTableBuilder_.mergeFrom(value); sinceKotlinInfoTableBuilder_.mergeFrom(value);
} }
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
@@ -13898,14 +14063,14 @@ public final class DebugProtoBuf {
} else { } else {
sinceKotlinInfoTableBuilder_.clear(); sinceKotlinInfoTableBuilder_.clear();
} }
bitField0_ = (bitField0_ & ~0x00004000); bitField0_ = (bitField0_ & ~0x00008000);
return this; return this;
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
*/ */
public org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.Builder getSinceKotlinInfoTableBuilder() { public org.jetbrains.kotlin.serialization.DebugProtoBuf.SinceKotlinInfoTable.Builder getSinceKotlinInfoTableBuilder() {
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
onChanged(); onChanged();
return getSinceKotlinInfoTableFieldBuilder().getBuilder(); return getSinceKotlinInfoTableFieldBuilder().getBuilder();
} }
@@ -27296,7 +27461,7 @@ public final class DebugProtoBuf {
"ter.Variance:\003INV\022=\n\013upper_bound\030\005 \003(\0132(" + "ter.Variance:\003INV\022=\n\013upper_bound\030\005 \003(\0132(" +
".org.jetbrains.kotlin.serialization.Type" + ".org.jetbrains.kotlin.serialization.Type" +
"\022\026\n\016upper_bound_id\030\006 \003(\005\"$\n\010Variance\022\006\n\002" + "\022\026\n\016upper_bound_id\030\006 \003(\005\"$\n\010Variance\022\006\n\002" +
"IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\236\007\n\005Class\022" + "IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\307\007\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", "\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\022I\n" + "\022#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022I\n" +
"\016type_parameter\030\005 \003(\01321.org.jetbrains.ko" + "\016type_parameter\030\005 \003(\01321.org.jetbrains.ko" +
@@ -27312,86 +27477,87 @@ public final class DebugProtoBuf {
"_alias\030\013 \003(\0132-.org.jetbrains.kotlin.seri" + "_alias\030\013 \003(\0132-.org.jetbrains.kotlin.seri" +
"alization.TypeAlias\022A\n\nenum_entry\030\r \003(\0132" + "alization.TypeAlias\022A\n\nenum_entry\030\r \003(\0132" +
"-.org.jetbrains.kotlin.serialization.Enu" + "-.org.jetbrains.kotlin.serialization.Enu" +
"mEntry\022A\n\ntype_table\030\036 \001(\0132-.org.jetbrai" + "mEntry\022\'\n\027sealed_subclass_fq_name\030\020 \003(\005B" +
"ns.kotlin.serialization.TypeTable\022\027\n\017sin" + "\006\020\001\220\265\030\001\022A\n\ntype_table\030\036 \001(\0132-.org.jetbra" +
"ceKotlinInfo\030\037 \001(\005\022Y\n\027since_kotlin_info_" + "ins.kotlin.serialization.TypeTable\022\027\n\017si" +
"table\030 \001(\01328.org.jetbrains.kotlin.seria" + "nceKotlinInfo\030\037 \001(\005\022Y\n\027since_kotlin_info" +
"lization.SinceKotlinInfoTable\"x\n\004Kind\022\t\n" + "_table\030 \001(\01328.org.jetbrains.kotlin.seri" +
"\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_CLASS\020\002\022", "alization.SinceKotlinInfoTable\"x\n\004Kind\022\t",
"\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLASS\020\004\022\n\n" + "\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_CLASS\020\002" +
"\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*\005\010d\020\310\001\"\361" + "\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLASS\020\004\022\n" +
"\002\n\007Package\022>\n\010function\030\003 \003(\0132,.org.jetbr" + "\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*\005\010d\020\310\001\"" +
"ains.kotlin.serialization.Function\022>\n\010pr" + "\361\002\n\007Package\022>\n\010function\030\003 \003(\0132,.org.jetb" +
"operty\030\004 \003(\0132,.org.jetbrains.kotlin.seri" + "rains.kotlin.serialization.Function\022>\n\010p" +
"alization.Property\022A\n\ntype_alias\030\005 \003(\0132-" + "roperty\030\004 \003(\0132,.org.jetbrains.kotlin.ser" +
"ialization.Property\022A\n\ntype_alias\030\005 \003(\0132" +
"-.org.jetbrains.kotlin.serialization.Typ" +
"eAlias\022A\n\ntype_table\030\036 \001(\0132-.org.jetbrai" +
"ns.kotlin.serialization.TypeTable\022Y\n\027sin",
"ce_kotlin_info_table\030 \001(\01328.org.jetbrai" +
"ns.kotlin.serialization.SinceKotlinInfoT" +
"able*\005\010d\020\310\001\"_\n\tTypeTable\0226\n\004type\030\001 \003(\0132(" +
".org.jetbrains.kotlin.serialization.Type" + ".org.jetbrains.kotlin.serialization.Type" +
"Alias\022A\n\ntype_table\030\036 \001(\0132-.org.jetbrain" + "\022\032\n\016first_nullable\030\002 \001(\005:\002-1\"\214\001\n\013Constru" +
"s.kotlin.serialization.TypeTable\022Y\n\027sinc" + "ctor\022\020\n\005flags\030\001 \001(\005:\0016\022K\n\017value_paramete" +
"e_kotlin_info_table\030 \001(\01328.org.jetbrain", "r\030\002 \003(\01322.org.jetbrains.kotlin.serializa" +
"s.kotlin.serialization.SinceKotlinInfoTa" + "tion.ValueParameter\022\027\n\017sinceKotlinInfo\030\037" +
"ble*\005\010d\020\310\001\"_\n\tTypeTable\0226\n\004type\030\001 \003(\0132(." + " \001(\005*\005\010d\020\310\001\"\363\003\n\010Function\022\020\n\005flags\030\t \001(\005:" +
"org.jetbrains.kotlin.serialization.Type\022" + "\0016\022\024\n\told_flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004",
"\032\n\016first_nullable\030\002 \001(\005:\002-1\"\214\001\n\013Construc" + "\210\265\030\001\022=\n\013return_type\030\003 \001(\0132(.org.jetbrain" +
"tor\022\020\n\005flags\030\001 \001(\005:\0016\022K\n\017value_parameter" + "s.kotlin.serialization.Type\022\026\n\016return_ty" +
"\030\002 \003(\01322.org.jetbrains.kotlin.serializat" + "pe_id\030\007 \001(\005\022I\n\016type_parameter\030\004 \003(\01321.or" +
"ion.ValueParameter\022\027\n\017sinceKotlinInfo\030\037 " + "g.jetbrains.kotlin.serialization.TypePar" +
"\001(\005*\005\010d\020\310\001\"\363\003\n\010Function\022\020\n\005flags\030\t \001(\005:\001" + "ameter\022?\n\rreceiver_type\030\005 \001(\0132(.org.jetb" +
"6\022\024\n\told_flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210" + "rains.kotlin.serialization.Type\022\030\n\020recei" +
"\265\030\001\022=\n\013return_type\030\003 \001(\0132(.org.jetbrains", "ver_type_id\030\010 \001(\005\022K\n\017value_parameter\030\006 \003" +
".kotlin.serialization.Type\022\026\n\016return_typ" + "(\01322.org.jetbrains.kotlin.serialization." +
"e_id\030\007 \001(\005\022I\n\016type_parameter\030\004 \003(\01321.org" + "ValueParameter\022A\n\ntype_table\030\036 \001(\0132-.org" +
".jetbrains.kotlin.serialization.TypePara" + ".jetbrains.kotlin.serialization.TypeTabl",
"meter\022?\n\rreceiver_type\030\005 \001(\0132(.org.jetbr" + "e\022\027\n\017sinceKotlinInfo\030\037 \001(\005*\005\010d\020\310\001\"\350\003\n\010Pr" +
"ains.kotlin.serialization.Type\022\030\n\020receiv" + "operty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030" +
"er_type_id\030\010 \001(\005\022K\n\017value_parameter\030\006 \003(" + "\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022=\n\013retur" +
"\01322.org.jetbrains.kotlin.serialization.V" + "n_type\030\003 \001(\0132(.org.jetbrains.kotlin.seri" +
"alueParameter\022A\n\ntype_table\030\036 \001(\0132-.org." + "alization.Type\022\026\n\016return_type_id\030\t \001(\005\022I" +
"jetbrains.kotlin.serialization.TypeTable" + "\n\016type_parameter\030\004 \003(\01321.org.jetbrains.k" +
"\022\027\n\017sinceKotlinInfo\030\037 \001(\005*\005\010d\020\310\001\"\350\003\n\010Pro", "otlin.serialization.TypeParameter\022?\n\rrec" +
"perty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030\001" + "eiver_type\030\005 \001(\0132(.org.jetbrains.kotlin." +
" \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022=\n\013return" + "serialization.Type\022\030\n\020receiver_type_id\030\n" +
"_type\030\003 \001(\0132(.org.jetbrains.kotlin.seria" + " \001(\005\022R\n\026setter_value_parameter\030\006 \001(\01322.o",
"lization.Type\022\026\n\016return_type_id\030\t \001(\005\022I\n" + "rg.jetbrains.kotlin.serialization.ValueP" +
"\016type_parameter\030\004 \003(\01321.org.jetbrains.ko" + "arameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter" +
"tlin.serialization.TypeParameter\022?\n\rrece" + "_flags\030\010 \001(\005\022\027\n\017sinceKotlinInfo\030\037 \001(\005*\005\010" +
"iver_type\030\005 \001(\0132(.org.jetbrains.kotlin.s" + "d\020\310\001\"\355\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\001" +
"erialization.Type\022\030\n\020receiver_type_id\030\n " + "0\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0226\n\004type\030\003 \001(\0132(.or" +
"\001(\005\022R\n\026setter_value_parameter\030\006 \001(\01322.or" + "g.jetbrains.kotlin.serialization.Type\022\017\n" +
"g.jetbrains.kotlin.serialization.ValuePa", "\007type_id\030\005 \001(\005\022E\n\023vararg_element_type\030\004 " +
"rameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_" + "\001(\0132(.org.jetbrains.kotlin.serialization" +
"flags\030\010 \001(\005\022\027\n\017sinceKotlinInfo\030\037 \001(\005*\005\010d" + ".Type\022\036\n\026vararg_element_type_id\030\006 \001(\005*\005\010" +
"\020\310\001\"\355\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\0010" + "d\020\310\001\"\232\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004",
"\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0226\n\004type\030\003 \001(\0132(.org" + "name\030\002 \002(\005B\004\210\265\030\001\022I\n\016type_parameter\030\003 \003(\013" +
".jetbrains.kotlin.serialization.Type\022\017\n\007" + "21.org.jetbrains.kotlin.serialization.Ty" +
"type_id\030\005 \001(\005\022E\n\023vararg_element_type\030\004 \001" + "peParameter\022A\n\017underlying_type\030\004 \001(\0132(.o" +
"(\0132(.org.jetbrains.kotlin.serialization." + "rg.jetbrains.kotlin.serialization.Type\022\032" +
"Type\022\036\n\026vararg_element_type_id\030\006 \001(\005*\005\010d" + "\n\022underlying_type_id\030\005 \001(\005\022?\n\rexpanded_t" +
"\020\310\001\"\232\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004n" + "ype\030\006 \001(\0132(.org.jetbrains.kotlin.seriali" +
"ame\030\002 \002(\005B\004\210\265\030\001\022I\n\016type_parameter\030\003 \003(\0132", "zation.Type\022\030\n\020expanded_type_id\030\007 \001(\005\022B\n" +
"1.org.jetbrains.kotlin.serialization.Typ" + "\nannotation\030\010 \003(\0132..org.jetbrains.kotlin" +
"eParameter\022A\n\017underlying_type\030\004 \001(\0132(.or" + ".serialization.Annotation\022\027\n\017sinceKotlin" +
"g.jetbrains.kotlin.serialization.Type\022\032\n" + "Info\030\037 \001(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001",
"\022underlying_type_id\030\005 \001(\005\022?\n\rexpanded_ty" + " \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\341\001\n\017SinceKotlinInfo\022\017\n" +
"pe\030\006 \001(\0132(.org.jetbrains.kotlin.serializ" + "\007version\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022O\n\005" +
"ation.Type\022\030\n\020expanded_type_id\030\007 \001(\005\022B\n\n" + "level\030\003 \001(\01629.org.jetbrains.kotlin.seria" +
"annotation\030\010 \003(\0132..org.jetbrains.kotlin." + "lization.SinceKotlinInfo.Level:\005ERROR\022\022\n" +
"serialization.Annotation\022\027\n\017sinceKotlinI" + "\nerror_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001" +
"nfo\030\037 \001(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001 " + "\"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HID" +
"\001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\341\001\n\017SinceKotlinInfo\022\017\n\007", "DEN\020\002\"Y\n\024SinceKotlinInfoTable\022A\n\004info\030\001 " +
"version\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022O\n\005l" + "\003(\01323.org.jetbrains.kotlin.serialization" +
"evel\030\003 \001(\01629.org.jetbrains.kotlin.serial" + ".SinceKotlinInfo*9\n\010Modality\022\t\n\005FINAL\020\000\022" +
"ization.SinceKotlinInfo.Level:\005ERROR\022\022\n\n" + "\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003*b\n\nV",
"error_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\"" + "isibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\t" +
"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HIDD" + "PROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_TO_TH" +
"EN\020\002\"Y\n\024SinceKotlinInfoTable\022A\n\004info\030\001 \003" + "IS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DECLARA" +
"(\01323.org.jetbrains.kotlin.serialization." + "TION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGATION\020" +
"SinceKotlinInfo*9\n\010Modality\022\t\n\005FINAL\020\000\022\010" + "\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
"\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003*b\n\nVi" +
"sibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tP",
"ROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_TO_THI" +
"S\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DECLARAT" +
"ION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGATION\020\002" +
"\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
}; };
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -27465,7 +27631,7 @@ public final class DebugProtoBuf {
internal_static_org_jetbrains_kotlin_serialization_Class_fieldAccessorTable = new internal_static_org_jetbrains_kotlin_serialization_Class_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable( org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_serialization_Class_descriptor, internal_static_org_jetbrains_kotlin_serialization_Class_descriptor,
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "TypeTable", "SinceKotlinInfo", "SinceKotlinInfoTable", }); new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "TypeTable", "SinceKotlinInfo", "SinceKotlinInfoTable", });
internal_static_org_jetbrains_kotlin_serialization_Package_descriptor = internal_static_org_jetbrains_kotlin_serialization_Package_descriptor =
getDescriptor().getMessageTypes().get(6); getDescriptor().getMessageTypes().get(6);
internal_static_org_jetbrains_kotlin_serialization_Package_fieldAccessorTable = new internal_static_org_jetbrains_kotlin_serialization_Package_fieldAccessorTable = new
@@ -27541,6 +27707,7 @@ public final class DebugProtoBuf {
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.fqNameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable); registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils.isEnumEntry
import org.jetbrains.kotlin.resolve.MemberComparator import org.jetbrains.kotlin.resolve.MemberComparator
import org.jetbrains.kotlin.resolve.constants.NullValue import org.jetbrains.kotlin.resolve.constants.NullValue
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.utils.Interner import org.jetbrains.kotlin.utils.Interner
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
@@ -116,6 +117,10 @@ class DescriptorSerializer private constructor(
} }
} }
for (sealedSubclass in classDescriptor.sealedSubclasses) {
builder.addSealedSubclassFqName(getClassifierId(sealedSubclass))
}
val companionObjectDescriptor = classDescriptor.companionObjectDescriptor val companionObjectDescriptor = classDescriptor.companionObjectDescriptor
if (companionObjectDescriptor != null) { if (companionObjectDescriptor != null) {
builder.companionObjectName = getSimpleNameIndex(companionObjectDescriptor.name) builder.companionObjectName = getSimpleNameIndex(companionObjectDescriptor.name)
@@ -0,0 +1,38 @@
// FILE: A.kt
package a
sealed class Empty
sealed class OnlyNested {
class Nested : OnlyNested()
}
sealed class NestedAndTopLevel {
class Nested : NestedAndTopLevel()
}
class TopLevel : NestedAndTopLevel()
// FILE: B.kt
import a.*
// This test checks that we correctly load subclasses of a compiled sealed class from binaries.
// It's not a diagnostic test because there are no diagnostic tests where resolution is performed against compiled Kotlin binaries
fun empty(e: Empty): String = when (e) {
else -> "1"
}
fun onlyNested(on: OnlyNested): String = when (on) {
is OnlyNested.Nested -> "2"
}
fun nestedAndTopLevel(natl: NestedAndTopLevel): String = when (natl) {
is NestedAndTopLevel.Nested -> "3"
is TopLevel -> "4"
}
fun box(): String {
return "OK"
}
@@ -204,6 +204,12 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
doTest(fileName); doTest(fileName);
} }
@TestMetadata("sealedClass.kt")
public void testSealedClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/sealedClass.kt");
doTest(fileName);
}
@TestMetadata("secondaryConstructors.kt") @TestMetadata("secondaryConstructors.kt")
public void testSecondaryConstructors() throws Exception { public void testSecondaryConstructors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/secondaryConstructors.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/secondaryConstructors.kt");
@@ -206,6 +206,8 @@ message Class {
repeated EnumEntry enum_entry = 13; repeated EnumEntry enum_entry = 13;
repeated int32 sealed_subclass_fq_name = 16 [packed = true, (fq_name_id_in_table) = true];
optional TypeTable type_table = 30; optional TypeTable type_table = 30;
// Index into the SinceKotlinInfoTable // Index into the SinceKotlinInfoTable
@@ -8095,6 +8095,19 @@ public final class ProtoBuf {
*/ */
int getEnumEntryCount(); int getEnumEntryCount();
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
java.util.List<java.lang.Integer> getSealedSubclassFqNameList();
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
int getSealedSubclassFqNameCount();
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
int getSealedSubclassFqName(int index);
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
@@ -8294,6 +8307,27 @@ public final class ProtoBuf {
enumEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.EnumEntry.PARSER, extensionRegistry)); enumEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.EnumEntry.PARSER, extensionRegistry));
break; break;
} }
case 128: {
if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00001000;
}
sealedSubclassFqName_.add(input.readInt32());
break;
}
case 130: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00001000) == 0x00001000) && input.getBytesUntilLimit() > 0) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00001000;
}
while (input.getBytesUntilLimit() > 0) {
sealedSubclassFqName_.add(input.readInt32());
}
input.popLimit(limit);
break;
}
case 242: { case 242: {
org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.Builder subBuilder = null; org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
@@ -8360,6 +8394,9 @@ public final class ProtoBuf {
if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_);
} }
if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
}
try { try {
unknownFieldsCodedOutput.flush(); unknownFieldsCodedOutput.flush();
} catch (java.io.IOException e) { } catch (java.io.IOException e) {
@@ -8849,6 +8886,29 @@ public final class ProtoBuf {
return enumEntry_.get(index); return enumEntry_.get(index);
} }
public static final int SEALED_SUBCLASS_FQ_NAME_FIELD_NUMBER = 16;
private java.util.List<java.lang.Integer> sealedSubclassFqName_;
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public java.util.List<java.lang.Integer>
getSealedSubclassFqNameList() {
return sealedSubclassFqName_;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqNameCount() {
return sealedSubclassFqName_.size();
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqName(int index) {
return sealedSubclassFqName_.get(index);
}
private int sealedSubclassFqNameMemoizedSerializedSize = -1;
public static final int TYPE_TABLE_FIELD_NUMBER = 30; public static final int TYPE_TABLE_FIELD_NUMBER = 30;
private org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable typeTable_; private org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable typeTable_;
/** /**
@@ -8915,6 +8975,7 @@ public final class ProtoBuf {
property_ = java.util.Collections.emptyList(); property_ = java.util.Collections.emptyList();
typeAlias_ = java.util.Collections.emptyList(); typeAlias_ = java.util.Collections.emptyList();
enumEntry_ = java.util.Collections.emptyList(); enumEntry_ = java.util.Collections.emptyList();
sealedSubclassFqName_ = java.util.Collections.emptyList();
typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance(); typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance();
sinceKotlinInfo_ = 0; sinceKotlinInfo_ = 0;
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance(); sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance();
@@ -9035,6 +9096,13 @@ public final class ProtoBuf {
for (int i = 0; i < enumEntry_.size(); i++) { for (int i = 0; i < enumEntry_.size(); i++) {
output.writeMessage(13, enumEntry_.get(i)); output.writeMessage(13, enumEntry_.get(i));
} }
if (getSealedSubclassFqNameList().size() > 0) {
output.writeRawVarint32(130);
output.writeRawVarint32(sealedSubclassFqNameMemoizedSerializedSize);
}
for (int i = 0; i < sealedSubclassFqName_.size(); i++) {
output.writeInt32NoTag(sealedSubclassFqName_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(30, typeTable_); output.writeMessage(30, typeTable_);
} }
@@ -9122,6 +9190,20 @@ public final class ProtoBuf {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(13, enumEntry_.get(i)); .computeMessageSize(13, enumEntry_.get(i));
} }
{
int dataSize = 0;
for (int i = 0; i < sealedSubclassFqName_.size(); i++) {
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(sealedSubclassFqName_.get(i));
}
size += dataSize;
if (!getSealedSubclassFqNameList().isEmpty()) {
size += 2;
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
sealedSubclassFqNameMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(30, typeTable_); .computeMessageSize(30, typeTable_);
@@ -9252,12 +9334,14 @@ public final class ProtoBuf {
bitField0_ = (bitField0_ & ~0x00000400); bitField0_ = (bitField0_ & ~0x00000400);
enumEntry_ = java.util.Collections.emptyList(); enumEntry_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000800); bitField0_ = (bitField0_ & ~0x00000800);
typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance(); sealedSubclassFqName_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00001000); bitField0_ = (bitField0_ & ~0x00001000);
sinceKotlinInfo_ = 0; typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance();
bitField0_ = (bitField0_ & ~0x00002000); bitField0_ = (bitField0_ & ~0x00002000);
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance(); sinceKotlinInfo_ = 0;
bitField0_ = (bitField0_ & ~0x00004000); bitField0_ = (bitField0_ & ~0x00004000);
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance();
bitField0_ = (bitField0_ & ~0x00008000);
return this; return this;
} }
@@ -9338,15 +9422,20 @@ public final class ProtoBuf {
bitField0_ = (bitField0_ & ~0x00000800); bitField0_ = (bitField0_ & ~0x00000800);
} }
result.enumEntry_ = enumEntry_; result.enumEntry_ = enumEntry_;
if (((from_bitField0_ & 0x00001000) == 0x00001000)) { if (((bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
bitField0_ = (bitField0_ & ~0x00001000);
}
result.sealedSubclassFqName_ = sealedSubclassFqName_;
if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
to_bitField0_ |= 0x00000008; to_bitField0_ |= 0x00000008;
} }
result.typeTable_ = typeTable_; result.typeTable_ = typeTable_;
if (((from_bitField0_ & 0x00002000) == 0x00002000)) { if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
to_bitField0_ |= 0x00000010; to_bitField0_ |= 0x00000010;
} }
result.sinceKotlinInfo_ = sinceKotlinInfo_; result.sinceKotlinInfo_ = sinceKotlinInfo_;
if (((from_bitField0_ & 0x00004000) == 0x00004000)) { if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
to_bitField0_ |= 0x00000020; to_bitField0_ |= 0x00000020;
} }
result.sinceKotlinInfoTable_ = sinceKotlinInfoTable_; result.sinceKotlinInfoTable_ = sinceKotlinInfoTable_;
@@ -9454,6 +9543,16 @@ public final class ProtoBuf {
enumEntry_.addAll(other.enumEntry_); enumEntry_.addAll(other.enumEntry_);
} }
}
if (!other.sealedSubclassFqName_.isEmpty()) {
if (sealedSubclassFqName_.isEmpty()) {
sealedSubclassFqName_ = other.sealedSubclassFqName_;
bitField0_ = (bitField0_ & ~0x00001000);
} else {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.addAll(other.sealedSubclassFqName_);
}
} }
if (other.hasTypeTable()) { if (other.hasTypeTable()) {
mergeTypeTable(other.getTypeTable()); mergeTypeTable(other.getTypeTable());
@@ -10688,12 +10787,78 @@ public final class ProtoBuf {
return this; return this;
} }
private java.util.List<java.lang.Integer> sealedSubclassFqName_ = java.util.Collections.emptyList();
private void ensureSealedSubclassFqNameIsMutable() {
if (!((bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = new java.util.ArrayList<java.lang.Integer>(sealedSubclassFqName_);
bitField0_ |= 0x00001000;
}
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public java.util.List<java.lang.Integer>
getSealedSubclassFqNameList() {
return java.util.Collections.unmodifiableList(sealedSubclassFqName_);
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqNameCount() {
return sealedSubclassFqName_.size();
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public int getSealedSubclassFqName(int index) {
return sealedSubclassFqName_.get(index);
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder setSealedSubclassFqName(
int index, int value) {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.set(index, value);
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder addSealedSubclassFqName(int value) {
ensureSealedSubclassFqNameIsMutable();
sealedSubclassFqName_.add(value);
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder addAllSealedSubclassFqName(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensureSealedSubclassFqNameIsMutable();
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, sealedSubclassFqName_);
return this;
}
/**
* <code>repeated int32 sealed_subclass_fq_name = 16 [packed = true];</code>
*/
public Builder clearSealedSubclassFqName() {
sealedSubclassFqName_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00001000);
return this;
}
private org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance(); private org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance();
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
public boolean hasTypeTable() { public boolean hasTypeTable() {
return ((bitField0_ & 0x00001000) == 0x00001000); return ((bitField0_ & 0x00002000) == 0x00002000);
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
@@ -10710,7 +10875,7 @@ public final class ProtoBuf {
} }
typeTable_ = value; typeTable_ = value;
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
@@ -10720,14 +10885,14 @@ public final class ProtoBuf {
org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.Builder builderForValue) { org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.Builder builderForValue) {
typeTable_ = builderForValue.build(); typeTable_ = builderForValue.build();
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code> * <code>optional .org.jetbrains.kotlin.serialization.TypeTable type_table = 30;</code>
*/ */
public Builder mergeTypeTable(org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable value) { public Builder mergeTypeTable(org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable value) {
if (((bitField0_ & 0x00001000) == 0x00001000) && if (((bitField0_ & 0x00002000) == 0x00002000) &&
typeTable_ != org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ != org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance()) {
typeTable_ = typeTable_ =
org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial();
@@ -10735,7 +10900,7 @@ public final class ProtoBuf {
typeTable_ = value; typeTable_ = value;
} }
bitField0_ |= 0x00001000; bitField0_ |= 0x00002000;
return this; return this;
} }
/** /**
@@ -10744,7 +10909,7 @@ public final class ProtoBuf {
public Builder clearTypeTable() { public Builder clearTypeTable() {
typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance(); typeTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.TypeTable.getDefaultInstance();
bitField0_ = (bitField0_ & ~0x00001000); bitField0_ = (bitField0_ & ~0x00002000);
return this; return this;
} }
@@ -10757,7 +10922,7 @@ public final class ProtoBuf {
* </pre> * </pre>
*/ */
public boolean hasSinceKotlinInfo() { public boolean hasSinceKotlinInfo() {
return ((bitField0_ & 0x00002000) == 0x00002000); return ((bitField0_ & 0x00004000) == 0x00004000);
} }
/** /**
* <code>optional int32 sinceKotlinInfo = 31;</code> * <code>optional int32 sinceKotlinInfo = 31;</code>
@@ -10777,7 +10942,7 @@ public final class ProtoBuf {
* </pre> * </pre>
*/ */
public Builder setSinceKotlinInfo(int value) { public Builder setSinceKotlinInfo(int value) {
bitField0_ |= 0x00002000; bitField0_ |= 0x00004000;
sinceKotlinInfo_ = value; sinceKotlinInfo_ = value;
return this; return this;
@@ -10790,7 +10955,7 @@ public final class ProtoBuf {
* </pre> * </pre>
*/ */
public Builder clearSinceKotlinInfo() { public Builder clearSinceKotlinInfo() {
bitField0_ = (bitField0_ & ~0x00002000); bitField0_ = (bitField0_ & ~0x00004000);
sinceKotlinInfo_ = 0; sinceKotlinInfo_ = 0;
return this; return this;
@@ -10801,7 +10966,7 @@ public final class ProtoBuf {
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
*/ */
public boolean hasSinceKotlinInfoTable() { public boolean hasSinceKotlinInfoTable() {
return ((bitField0_ & 0x00004000) == 0x00004000); return ((bitField0_ & 0x00008000) == 0x00008000);
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
@@ -10818,7 +10983,7 @@ public final class ProtoBuf {
} }
sinceKotlinInfoTable_ = value; sinceKotlinInfoTable_ = value;
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
@@ -10828,14 +10993,14 @@ public final class ProtoBuf {
org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.Builder builderForValue) { org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.Builder builderForValue) {
sinceKotlinInfoTable_ = builderForValue.build(); sinceKotlinInfoTable_ = builderForValue.build();
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
* <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code> * <code>optional .org.jetbrains.kotlin.serialization.SinceKotlinInfoTable since_kotlin_info_table = 32;</code>
*/ */
public Builder mergeSinceKotlinInfoTable(org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable value) { public Builder mergeSinceKotlinInfoTable(org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable value) {
if (((bitField0_ & 0x00004000) == 0x00004000) && if (((bitField0_ & 0x00008000) == 0x00008000) &&
sinceKotlinInfoTable_ != org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance()) { sinceKotlinInfoTable_ != org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance()) {
sinceKotlinInfoTable_ = sinceKotlinInfoTable_ =
org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.newBuilder(sinceKotlinInfoTable_).mergeFrom(value).buildPartial(); org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.newBuilder(sinceKotlinInfoTable_).mergeFrom(value).buildPartial();
@@ -10843,7 +11008,7 @@ public final class ProtoBuf {
sinceKotlinInfoTable_ = value; sinceKotlinInfoTable_ = value;
} }
bitField0_ |= 0x00004000; bitField0_ |= 0x00008000;
return this; return this;
} }
/** /**
@@ -10852,7 +11017,7 @@ public final class ProtoBuf {
public Builder clearSinceKotlinInfoTable() { public Builder clearSinceKotlinInfoTable() {
sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance(); sinceKotlinInfoTable_ = org.jetbrains.kotlin.serialization.ProtoBuf.SinceKotlinInfoTable.getDefaultInstance();
bitField0_ = (bitField0_ & ~0x00004000); bitField0_ = (bitField0_ & ~0x00008000);
return this; return this;
} }
@@ -150,7 +150,16 @@ class DeserializedClassDescriptor(
name in memberScope.classNames name in memberScope.classNames
private fun computeSubclassesForSealedClass(): Collection<ClassDescriptor> { private fun computeSubclassesForSealedClass(): Collection<ClassDescriptor> {
// TODO: store the list of subclasses to metadata if (modality != Modality.SEALED) return emptyList()
val fqNames = classProto.sealedSubclassFqNameList
if (fqNames.isNotEmpty()) {
return fqNames.mapNotNull { index ->
c.components.deserializeClass(c.nameResolver.getClassId(index))
}
}
// This is needed because classes compiled with Kotlin 1.0 did not contain the sealed_subclass_fq_name field
return computeSealedSubclasses(this) return computeSealedSubclasses(this)
} }