AA: make KtClassifierSymbol a subtype of KtAnnotatedSymbol

This commit is contained in:
Jiaxiang Chen
2022-05-16 15:57:08 -07:00
committed by teamcity
parent 866ebcfe2e
commit 8f4554959e
9 changed files with 33 additions and 3 deletions
@@ -6,7 +6,9 @@
package org.jetbrains.kotlin.analysis.api.fir.symbols package org.jetbrains.kotlin.analysis.api.fir.symbols
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.analysis.api.annotations.KtAnnotationsList
import org.jetbrains.kotlin.analysis.api.fir.KtSymbolByFirBuilder import org.jetbrains.kotlin.analysis.api.fir.KtSymbolByFirBuilder
import org.jetbrains.kotlin.analysis.api.fir.annotations.KtFirAnnotationListForDeclaration
import org.jetbrains.kotlin.analysis.api.fir.findPsi import org.jetbrains.kotlin.analysis.api.fir.findPsi
import org.jetbrains.kotlin.analysis.api.fir.utils.cached import org.jetbrains.kotlin.analysis.api.fir.utils.cached
import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol
@@ -28,6 +30,11 @@ internal class KtFirTypeParameterSymbol(
) : KtTypeParameterSymbol(), KtFirSymbol<FirTypeParameterSymbol> { ) : KtTypeParameterSymbol(), KtFirSymbol<FirTypeParameterSymbol> {
override val psi: PsiElement? by cached { firSymbol.findPsi() } override val psi: PsiElement? by cached { firSymbol.findPsi() }
override val annotationsList: KtAnnotationsList
get() = withValidityAssertion {
KtFirAnnotationListForDeclaration.create(firSymbol, firResolveSession.useSiteFirSession, token)
}
override val name: Name get() = withValidityAssertion { firSymbol.name } override val name: Name get() = withValidityAssertion { firSymbol.name }
override val upperBounds: List<KtType> by cached { override val upperBounds: List<KtType> by cached {
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.Variance
public sealed class KtClassifierSymbol : KtSymbol, KtPossiblyNamedSymbol, KtDeclarationSymbol public sealed class KtClassifierSymbol : KtSymbol, KtAnnotatedSymbol, KtPossiblyNamedSymbol, KtDeclarationSymbol
public val KtClassifierSymbol.nameOrAnonymous: Name public val KtClassifierSymbol.nameOrAnonymous: Name
get() = name ?: SpecialNames.ANONYMOUS get() = name ?: SpecialNames.ANONYMOUS
@@ -1,2 +1,3 @@
class A<T, R> { import org.jetbrains.annotations.NotNull
class A<@NotNull T, R> {
} }
@@ -1 +1 @@
class A<T, R> class A<@org.jetbrains.annotations.NotNull T, R>
@@ -1,4 +1,8 @@
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: [
org/jetbrains/annotations/NotNull()
psi: KtAnnotationEntry
]
isReified: false isReified: false
name: T name: T
origin: SOURCE origin: SOURCE
@@ -10,6 +14,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: R name: R
origin: SOURCE origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: X name: X
origin: SOURCE origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T name: T
origin: SOURCE origin: SOURCE
@@ -10,6 +11,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T1 name: T1
origin: SOURCE origin: SOURCE
@@ -45,6 +47,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T2 name: T2
origin: SOURCE origin: SOURCE
@@ -80,6 +83,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T3 name: T3
origin: SOURCE origin: SOURCE
@@ -91,6 +95,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T4 name: T4
origin: SOURCE origin: SOURCE
@@ -102,6 +107,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T5 name: T5
origin: SOURCE origin: SOURCE
@@ -137,6 +143,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T6 name: T6
origin: SOURCE origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T name: T
origin: SOURCE origin: SOURCE
@@ -10,6 +11,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T1 name: T1
origin: SOURCE origin: SOURCE
@@ -45,6 +47,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T2 name: T2
origin: SOURCE origin: SOURCE
@@ -80,6 +83,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T3 name: T3
origin: SOURCE origin: SOURCE
@@ -91,6 +95,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T4 name: T4
origin: SOURCE origin: SOURCE
@@ -102,6 +107,7 @@ KtTypeParameterSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T5 name: T5
origin: SOURCE origin: SOURCE
@@ -137,6 +143,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T6 name: T6
origin: SOURCE origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: T name: T
origin: SOURCE origin: SOURCE
@@ -34,6 +35,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null deprecationStatus: null
KtTypeParameterSymbol: KtTypeParameterSymbol:
annotationsList: []
isReified: false isReified: false
name: Z name: Z
origin: SOURCE origin: SOURCE