[FIR] Serialize annotations for type parameters properly

This commit is contained in:
Mads Ager
2021-11-30 14:04:12 +01:00
committed by TeamCityServer
parent 76b332b635
commit d89680b30d
2 changed files with 4 additions and 7 deletions
@@ -610,10 +610,6 @@ class FirElementSerializer private constructor(
private fun typeProto(typeRef: FirTypeRef, toSuper: Boolean = false): ProtoBuf.Type.Builder {
val coneType = typeRef.coneType
return typeProto(coneType, toSuper, correspondingTypeRef = typeRef).also { typeProto ->
for (annotation in coneType.attributes.customAnnotations) {
extension.serializeTypeAnnotation(annotation, typeProto)
}
val compilerAttributes = mutableListOf<ConeAttribute<*>>()
val extensionAttributes = mutableListOf<ConeAttribute<*>>()
for (attribute in coneType.attributes) {
@@ -654,7 +650,6 @@ class FirElementSerializer private constructor(
isDefinitelyNotNullType: Boolean = false,
): ProtoBuf.Type.Builder {
val builder = ProtoBuf.Type.newBuilder()
when (type) {
is ConeDefinitelyNotNullType -> return typeProto(type.original, toSuper, correspondingTypeRef, isDefinitelyNotNullType = true)
is ConeKotlinErrorType -> {
@@ -726,6 +721,10 @@ class FirElementSerializer private constructor(
builder.nullable = type.isMarkedNullable
}
for (annotation in type.attributes.customAnnotations) {
extension.serializeTypeAnnotation(annotation, builder)
}
// TODO: abbreviated type
// val abbreviation = type.getAbbreviatedType()?.abbreviation
// if (abbreviation != null) {
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: No annotations found on type argument
// TARGET_BACKEND: JVM
// WITH_REFLECT