[FIR] CustomAnnotationTypeAttribute: support type aliases

^KTIJ-23547
^KTIJ-24141
This commit is contained in:
Dmitrii Gridin
2023-01-17 15:39:09 +01:00
committed by Space Team
parent 0e2967e520
commit 73cdaf5c3c
11 changed files with 116 additions and 12 deletions
@@ -13,15 +13,20 @@ import kotlin.reflect.KClass
class CustomAnnotationTypeAttribute(
val annotations: List<FirAnnotation>,
val containerSymbol: FirBasedSymbol<out FirDeclaration>? = null,
val containerSymbols: List<FirBasedSymbol<out FirDeclaration>> = emptyList(),
) : ConeAttribute<CustomAnnotationTypeAttribute>() {
constructor(annotations: List<FirAnnotation>, containerSymbol: FirBasedSymbol<out FirDeclaration>?) : this(
annotations,
listOfNotNull(containerSymbol),
)
override fun union(other: CustomAnnotationTypeAttribute?): CustomAnnotationTypeAttribute? = null
override fun intersect(other: CustomAnnotationTypeAttribute?): CustomAnnotationTypeAttribute? = null
override fun add(other: CustomAnnotationTypeAttribute?): CustomAnnotationTypeAttribute {
if (other == null || other === this) return this
return CustomAnnotationTypeAttribute(annotations + other.annotations, containerSymbol)
return CustomAnnotationTypeAttribute(annotations + other.annotations, containerSymbols + other.containerSymbols)
}
override fun isSubtypeOf(other: CustomAnnotationTypeAttribute?): Boolean = true