Do not load built-ins in old format, drop class_name extension
This commit is contained in:
@@ -31,8 +31,6 @@ message BuiltIns {
|
||||
}
|
||||
|
||||
extend Package {
|
||||
// id in StringTable
|
||||
repeated int32 class_name = 150 [packed = true];
|
||||
optional int32 package_fq_name = 151;
|
||||
}
|
||||
|
||||
|
||||
-16
@@ -7,7 +7,6 @@ public final class BuiltInsProtoBuf {
|
||||
private BuiltInsProtoBuf() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
registry.add(org.jetbrains.kotlin.serialization.builtins.BuiltInsProtoBuf.className);
|
||||
registry.add(org.jetbrains.kotlin.serialization.builtins.BuiltInsProtoBuf.packageFqName);
|
||||
registry.add(org.jetbrains.kotlin.serialization.builtins.BuiltInsProtoBuf.classAnnotation);
|
||||
registry.add(org.jetbrains.kotlin.serialization.builtins.BuiltInsProtoBuf.constructorAnnotation);
|
||||
@@ -870,21 +869,6 @@ public final class BuiltInsProtoBuf {
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.builtins.BuiltIns)
|
||||
}
|
||||
|
||||
public static final int CLASS_NAME_FIELD_NUMBER = 150;
|
||||
/**
|
||||
* <code>extend .org.jetbrains.kotlin.serialization.Package { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessageLite.GeneratedExtension<
|
||||
org.jetbrains.kotlin.serialization.ProtoBuf.Package,
|
||||
java.util.List<java.lang.Integer>> className = com.google.protobuf.GeneratedMessageLite
|
||||
.newRepeatedGeneratedExtension(
|
||||
org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance(),
|
||||
null,
|
||||
null,
|
||||
150,
|
||||
com.google.protobuf.WireFormat.FieldType.INT32,
|
||||
true);
|
||||
public static final int PACKAGE_FQ_NAME_FIELD_NUMBER = 151;
|
||||
/**
|
||||
* <code>extend .org.jetbrains.kotlin.serialization.Package { ... }</code>
|
||||
|
||||
+1
-10
@@ -49,14 +49,7 @@ abstract class DeserializedPackageFragment(
|
||||
computeMemberScope()
|
||||
}
|
||||
|
||||
protected open fun computeMemberScope(): DeserializedPackageMemberScope {
|
||||
val packageStream = loadResourceSure(serializedResourcePaths.getPackageFilePath(fqName))
|
||||
val packageProto = ProtoBuf.Package.parseFrom(packageStream, serializedResourcePaths.extensionRegistry)
|
||||
return DeserializedPackageMemberScope(
|
||||
this, packageProto, nameResolver, packagePartSource = null, components = components,
|
||||
classNames = { loadClassNames(packageProto) }
|
||||
)
|
||||
}
|
||||
protected abstract fun computeMemberScope(): DeserializedPackageMemberScope
|
||||
|
||||
override fun getMemberScope() = deserializedMemberScope
|
||||
|
||||
@@ -64,8 +57,6 @@ abstract class DeserializedPackageFragment(
|
||||
return name in getMemberScope().classNames
|
||||
}
|
||||
|
||||
protected abstract fun loadClassNames(packageProto: ProtoBuf.Package): Collection<Name>
|
||||
|
||||
protected fun loadResourceSure(path: String): InputStream =
|
||||
loadResource(path) ?: throw IllegalStateException("Resource not found in classpath: $path")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user