[FIR] provide containerDeclaration to CustomAnnotationTypeAttribute for lazy resolve

tested by FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated.testTypeAnnotations

^KTIJ-23547 Fixed
^KTIJ-24141 Fixed
This commit is contained in:
Dmitrii Gridin
2023-01-10 14:41:42 +01:00
committed by Space Team
parent f32483000a
commit 9d42a5cb01
5 changed files with 56 additions and 24 deletions
@@ -5,18 +5,22 @@
package org.jetbrains.kotlin.fir.types
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.render
import kotlin.reflect.KClass
class CustomAnnotationTypeAttribute(val annotations: List<FirAnnotation>) : ConeAttribute<CustomAnnotationTypeAttribute>() {
class CustomAnnotationTypeAttribute(
val annotations: List<FirAnnotation>,
val containerDeclaration: FirDeclaration? = null,
) : ConeAttribute<CustomAnnotationTypeAttribute>() {
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)
return CustomAnnotationTypeAttribute(annotations + other.annotations, containerDeclaration)
}
override fun isSubtypeOf(other: CustomAnnotationTypeAttribute?): Boolean = true