[FIR] Serialize annotations for type parameters properly
This commit is contained in:
committed by
TeamCityServer
parent
76b332b635
commit
d89680b30d
+4
-5
@@ -610,10 +610,6 @@ class FirElementSerializer private constructor(
|
|||||||
private fun typeProto(typeRef: FirTypeRef, toSuper: Boolean = false): ProtoBuf.Type.Builder {
|
private fun typeProto(typeRef: FirTypeRef, toSuper: Boolean = false): ProtoBuf.Type.Builder {
|
||||||
val coneType = typeRef.coneType
|
val coneType = typeRef.coneType
|
||||||
return typeProto(coneType, toSuper, correspondingTypeRef = typeRef).also { typeProto ->
|
return typeProto(coneType, toSuper, correspondingTypeRef = typeRef).also { typeProto ->
|
||||||
for (annotation in coneType.attributes.customAnnotations) {
|
|
||||||
extension.serializeTypeAnnotation(annotation, typeProto)
|
|
||||||
}
|
|
||||||
|
|
||||||
val compilerAttributes = mutableListOf<ConeAttribute<*>>()
|
val compilerAttributes = mutableListOf<ConeAttribute<*>>()
|
||||||
val extensionAttributes = mutableListOf<ConeAttribute<*>>()
|
val extensionAttributes = mutableListOf<ConeAttribute<*>>()
|
||||||
for (attribute in coneType.attributes) {
|
for (attribute in coneType.attributes) {
|
||||||
@@ -654,7 +650,6 @@ class FirElementSerializer private constructor(
|
|||||||
isDefinitelyNotNullType: Boolean = false,
|
isDefinitelyNotNullType: Boolean = false,
|
||||||
): ProtoBuf.Type.Builder {
|
): ProtoBuf.Type.Builder {
|
||||||
val builder = ProtoBuf.Type.newBuilder()
|
val builder = ProtoBuf.Type.newBuilder()
|
||||||
|
|
||||||
when (type) {
|
when (type) {
|
||||||
is ConeDefinitelyNotNullType -> return typeProto(type.original, toSuper, correspondingTypeRef, isDefinitelyNotNullType = true)
|
is ConeDefinitelyNotNullType -> return typeProto(type.original, toSuper, correspondingTypeRef, isDefinitelyNotNullType = true)
|
||||||
is ConeKotlinErrorType -> {
|
is ConeKotlinErrorType -> {
|
||||||
@@ -726,6 +721,10 @@ class FirElementSerializer private constructor(
|
|||||||
builder.nullable = type.isMarkedNullable
|
builder.nullable = type.isMarkedNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (annotation in type.attributes.customAnnotations) {
|
||||||
|
extension.serializeTypeAnnotation(annotation, builder)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: abbreviated type
|
// TODO: abbreviated type
|
||||||
// val abbreviation = type.getAbbreviatedType()?.abbreviation
|
// val abbreviation = type.getAbbreviatedType()?.abbreviation
|
||||||
// if (abbreviation != null) {
|
// if (abbreviation != null) {
|
||||||
|
|||||||
-2
@@ -1,5 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// FIR status: No annotations found on type argument
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// WITH_REFLECT
|
// WITH_REFLECT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user