Support serialization/deserialization of local classes
Most of these changes are aimed to support and correctly transform ClassId for local classes, no actual bytes are written or read at the moment (see next commits). See the comment on ClassId for clarification. A hack in DescriptorSerializer which erased anonymous types to Any (which had been breaking the consistency between descriptors resolved from sources and from serialized information) is now gone
This commit is contained in:
+3
@@ -28,6 +28,9 @@ public class JavaClassDataFinder(
|
||||
) : ClassDataFinder {
|
||||
override fun findClassData(classId: ClassId): ClassData? {
|
||||
val kotlinJvmBinaryClass = kotlinClassFinder.findKotlinClass(classId) ?: return null
|
||||
assert(kotlinJvmBinaryClass.getClassId() == classId) {
|
||||
"Class with incorrect id found: expected $classId, actual ${kotlinJvmBinaryClass.getClassId()}"
|
||||
}
|
||||
val data = deserializedDescriptorResolver.readData(kotlinJvmBinaryClass, KotlinClassHeader.Kind.CLASS) ?: return null
|
||||
return JvmProtoBufUtil.readClassDataFrom(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user