Support annotations on type aliases declarations

This commit is contained in:
Denis Zharkov
2016-06-27 19:01:00 +03:00
parent e24f0653fb
commit d53c53a900
19 changed files with 686 additions and 24 deletions
@@ -306,6 +306,8 @@ class DescriptorSerializer private constructor(
builder.setExpandedType(local.type(expandedType))
}
builder.addAllAnnotation(descriptor.annotations.map { extension.annotationSerializer.serializeAnnotation(it) })
return builder
}
@@ -23,6 +23,8 @@ import org.jetbrains.kotlin.types.KotlinType
abstract class SerializerExtension {
abstract val stringTable: StringTable
val annotationSerializer by lazy { AnnotationSerializer(stringTable) }
open fun shouldUseTypeTable(): Boolean = false
open fun serializeClass(descriptor: ClassDescriptor, proto: ProtoBuf.Class.Builder) {
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.types.KotlinType
open class KotlinSerializerExtensionBase(private val protocol: SerializerExtensionProtocol) : SerializerExtension() {
override final val stringTable = StringTableImpl()
private val annotationSerializer = AnnotationSerializer(stringTable)
override fun serializeClass(descriptor: ClassDescriptor, proto: ProtoBuf.Class.Builder) {
for (annotation in descriptor.annotations) {