IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations. Implement WrappedTypeAliasDescriptor.
This commit is contained in:
@@ -452,6 +452,8 @@ class DescriptorSerializer private constructor(
|
||||
builder.addAnnotation(extension.annotationSerializer.serializeAnnotation(annotation))
|
||||
}
|
||||
|
||||
extension.serializeTypeAlias(descriptor, builder)
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ abstract class SerializerExtension {
|
||||
open fun serializeTypeParameter(typeParameter: TypeParameterDescriptor, proto: ProtoBuf.TypeParameter.Builder) {
|
||||
}
|
||||
|
||||
open fun serializeTypeAlias(typeAlias: TypeAliasDescriptor, proto: ProtoBuf.TypeAlias.Builder) {
|
||||
}
|
||||
|
||||
open fun serializeErrorType(type: KotlinType, builder: ProtoBuf.Type.Builder) {
|
||||
throw IllegalStateException("Cannot serialize error type: $type")
|
||||
}
|
||||
|
||||
+6
@@ -106,4 +106,10 @@ abstract class KotlinSerializerExtensionBase(private val protocol: SerializerExt
|
||||
proto.addExtension(protocol.typeParameterAnnotation, annotationSerializer.serializeAnnotation(annotation))
|
||||
}
|
||||
}
|
||||
|
||||
override fun serializeTypeAlias(typeAlias: TypeAliasDescriptor, proto: ProtoBuf.TypeAlias.Builder) {
|
||||
// TODO serialize annotations on type aliases?
|
||||
// (this requires more extensive protobuf scheme modifications)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user