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
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.annotations.KtFirAnnotationListForDeclaration
import org.jetbrains.kotlin.analysis.api.fir.findPsi
import org.jetbrains.kotlin.analysis.api.fir.utils.cached
import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol
@@ -28,6 +30,11 @@ internal class KtFirTypeParameterSymbol(
) : KtTypeParameterSymbol(), KtFirSymbol<FirTypeParameterSymbol> {
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 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.types.Variance
public sealed class KtClassifierSymbol : KtSymbol, KtPossiblyNamedSymbol, KtDeclarationSymbol
public sealed class KtClassifierSymbol : KtSymbol, KtAnnotatedSymbol, KtPossiblyNamedSymbol, KtDeclarationSymbol
public val KtClassifierSymbol.nameOrAnonymous: Name
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:
annotationsList: [
org/jetbrains/annotations/NotNull()
psi: KtAnnotationEntry
]
isReified: false
name: T
origin: SOURCE
@@ -10,6 +14,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: R
origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: X
origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T
origin: SOURCE
@@ -10,6 +11,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T1
origin: SOURCE
@@ -45,6 +47,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T2
origin: SOURCE
@@ -80,6 +83,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T3
origin: SOURCE
@@ -91,6 +95,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T4
origin: SOURCE
@@ -102,6 +107,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T5
origin: SOURCE
@@ -137,6 +143,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T6
origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T
origin: SOURCE
@@ -10,6 +11,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T1
origin: SOURCE
@@ -45,6 +47,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T2
origin: SOURCE
@@ -80,6 +83,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T3
origin: SOURCE
@@ -91,6 +95,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T4
origin: SOURCE
@@ -102,6 +107,7 @@ KtTypeParameterSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T5
origin: SOURCE
@@ -137,6 +143,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T6
origin: SOURCE
@@ -1,4 +1,5 @@
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: T
origin: SOURCE
@@ -34,6 +35,7 @@ KtNamedClassOrObjectSymbol:
deprecationStatus: null
KtTypeParameterSymbol:
annotationsList: []
isReified: false
name: Z
origin: SOURCE