[AA FIR] fix nested type annotations lazy resolve
^KT-56046
This commit is contained in:
committed by
Space Team
parent
3b99a5bf34
commit
d13ad454da
+12
@@ -76,6 +76,18 @@ public class Fe10IdeNormalAnalysisSourceModuleSingleSymbolByPsiGenerated extends
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/getterWithReceiverAndAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAlias.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAlias() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAliasAsAnnotation.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAliasAsAnnotation() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAliasAsAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithAnnotations.kt")
|
||||
public void testPropertyWithAnnotations() throws Exception {
|
||||
|
||||
+4
-2
@@ -17,6 +17,8 @@ import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.declarations.hasAnnotation
|
||||
import org.jetbrains.kotlin.fir.declarations.toAnnotationClassId
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
import org.jetbrains.kotlin.fir.symbols.resolvedAnnotationsWithArguments
|
||||
import org.jetbrains.kotlin.fir.symbols.resolvedAnnotationsWithClassIds
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.custom
|
||||
import org.jetbrains.kotlin.fir.types.customAnnotations
|
||||
@@ -82,8 +84,8 @@ private fun ConeKotlinType.customAnnotationsWithLazyResolve(phase: FirResolvePha
|
||||
|
||||
for (containerSymbol in custom.containerSymbols) {
|
||||
when (phase) {
|
||||
FirResolvePhase.TYPES -> containerSymbol.resolvedAnnotationsWithClassIds
|
||||
FirResolvePhase.ANNOTATIONS_ARGUMENTS_MAPPING -> containerSymbol.resolvedAnnotationsWithArguments
|
||||
FirResolvePhase.TYPES -> annotations.resolvedAnnotationsWithClassIds(containerSymbol)
|
||||
FirResolvePhase.ANNOTATIONS_ARGUMENTS_MAPPING -> annotations.resolvedAnnotationsWithArguments(containerSymbol)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -76,6 +76,18 @@ public class FirIdeNormalAnalysisSourceModuleSingleSymbolByPsiGenerated extends
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/getterWithReceiverAndAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAlias.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAlias() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAliasAsAnnotation.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAliasAsAnnotation() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAliasAsAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithAnnotations.kt")
|
||||
public void testPropertyWithAnnotations() throws Exception {
|
||||
|
||||
+12
@@ -76,6 +76,18 @@ public class FirStandaloneNormalAnalysisSourceModuleSingleSymbolByPsiGenerated e
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/getterWithReceiverAndAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAlias.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAlias() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAnnotationWithTypeAliasAsAnnotation.kt")
|
||||
public void testNestedTypeAnnotationWithTypeAliasAsAnnotation() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/nestedTypeAnnotationWithTypeAliasAsAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithAnnotations.kt")
|
||||
public void testPropertyWithAnnotations() throws Exception {
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo2(): kotlin.collections.List<kotlin.collections.List<@Anno3 @Anno2 @Anno1(s = "s") BaseAnnotation>>?
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|Anno3|() @R|Anno2|() @R|Anno1|(s = String(s)) @R|Anno3|() SecondTypeAlias>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno3|() @R|Anno2|() @R|Anno1|(s = String(s)) @R|Anno3|() SecondTypeAlias>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: @R|Anno3|() @R|Anno2|() @R|Anno1|(s = String(s)) @R|Anno3|() SecondTypeAlias
|
||||
annotationsList: [
|
||||
Anno3()
|
||||
psi: KtAnnotationEntry
|
||||
Anno2()
|
||||
psi: KtAnnotationEntry
|
||||
Anno1(s = "s")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
ownTypeArguments: []
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
// PRETTY_RENDERER_OPTION: FULLY_EXPANDED_TYPES
|
||||
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno1(val s: String)
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno2
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno3
|
||||
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class BaseAnnotation
|
||||
|
||||
typealias FirstTypeAlias = @Anno1("s") BaseAnnotation
|
||||
typealias SecondTypeAlias = @Anno2 FirstTypeAlias
|
||||
|
||||
fun f<caret>oo2(): List<List<@Anno3 SecondTypeAlias>>? = null
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo2(): kotlin.collections.List<kotlin.collections.List<@Anno1(s = "s") @Anno2 @Anno3 BaseAnnotation>>?
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|Anno3|() SecondTypeAlias>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno3|() SecondTypeAlias>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: @R|Anno1|(s = String(s)) @R|Anno2|() @R|Anno3|() BaseAnnotation
|
||||
annotationsList: [
|
||||
Anno1(s = "s")
|
||||
psi: KtAnnotationEntry
|
||||
Anno2()
|
||||
psi: KtAnnotationEntry
|
||||
Anno3()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
ownTypeArguments: []
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo2)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|BaseAnnotation|() T>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|BaseAnnotation|() T>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|BaseAnnotation|() T
|
||||
annotationsList: [
|
||||
BaseAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
// PRETTY_RENDERER_OPTION: FULLY_EXPANDED_TYPES
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno1(val s: String)
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno2
|
||||
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class BaseAnnotation
|
||||
|
||||
typealias FirstTypeAlias = @Anno1("s") BaseAnnotation
|
||||
typealias SecondTypeAlias = @Anno2 FirstTypeAlias
|
||||
|
||||
fun <T> T.f<caret>oo2(): List<List<@SecondTypeAlias T>>? = null
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun <T> T.foo2(): kotlin.collections.List<kotlin.collections.List<@BaseAnnotation T>>?
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo2)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|SecondTypeAlias|() T>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|SecondTypeAlias|() T>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|SecondTypeAlias|() T
|
||||
annotationsList: [
|
||||
BaseAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+259
@@ -118,6 +118,144 @@ KtNamedClassOrObjectSymbol:
|
||||
annotationApplicableTargets: [TYPE]
|
||||
deprecationStatus: null
|
||||
|
||||
KtConstructorSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
containingClassIdIfNonLocal: Anno5
|
||||
contextReceivers: []
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isPrimary: true
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /Anno5.s
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: false
|
||||
hasStableParameterNames: true
|
||||
isDefault: true
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
hasBackingField: true
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: null
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: s
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
setter: null
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getS
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: s
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: [
|
||||
kotlin/annotation/Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
classIdIfNonLocal: Anno5
|
||||
classKind: ANNOTATION_CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isData: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Anno5
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/Annotation
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: [TYPE]
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: I
|
||||
@@ -312,4 +450,125 @@ KtNamedClassOrObjectSymbol:
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtTypeParameterSymbol:
|
||||
annotationsList: []
|
||||
isReified: false
|
||||
name: T
|
||||
origin: SOURCE
|
||||
typeParameters: []
|
||||
upperBounds: []
|
||||
variance: INVARIANT
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno5|(s = String(1)) T>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|Anno5|(s = String(1)) T
|
||||
annotationsList: [
|
||||
Anno5(s = "1")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtTypeParameterSymbol:
|
||||
annotationsList: []
|
||||
isReified: false
|
||||
name: T
|
||||
origin: SOURCE
|
||||
typeParameters: []
|
||||
upperBounds: []
|
||||
variance: INVARIANT
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo2)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|Anno5|(s = String(1)) T>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno5|(s = String(1)) T>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|Anno5|(s = String(1)) T
|
||||
annotationsList: [
|
||||
Anno5(s = "1")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
@@ -1,4 +1,4 @@
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE_K1
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno1
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
@@ -7,6 +7,8 @@ annotation class Anno2
|
||||
annotation class Anno3
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno4
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class Anno5(val s: String)
|
||||
|
||||
interface I
|
||||
|
||||
@@ -14,3 +16,6 @@ class X : @Anno1 I {
|
||||
fun f(arg: @Anno2 I): @Anno3 I = arg
|
||||
val x: @Anno4 I = this
|
||||
}
|
||||
|
||||
fun <T> T.foo(): List<@Anno5("1") T>? = null
|
||||
fun <T> T.foo2(): List<List<@Anno5("1") T>>? = null
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
fun <T> T.foo(): kotlin.collections.List<@Anno5(s = "1") T>?
|
||||
|
||||
fun <T> T.foo2(): kotlin.collections.List<kotlin.collections.List<@Anno5(s = "1") T>>?
|
||||
|
||||
@kotlin.annotation.Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
|
||||
annotation class Anno1
|
||||
|
||||
@@ -10,6 +14,11 @@ annotation class Anno3
|
||||
@kotlin.annotation.Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
|
||||
annotation class Anno4
|
||||
|
||||
@kotlin.annotation.Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
|
||||
annotation class Anno5(s: kotlin.String) {
|
||||
val s: kotlin.String
|
||||
}
|
||||
|
||||
interface I
|
||||
|
||||
class X : @Anno1 I {
|
||||
|
||||
@@ -118,6 +118,144 @@ KtNamedClassOrObjectSymbol:
|
||||
annotationApplicableTargets: [TYPE]
|
||||
deprecationStatus: null
|
||||
|
||||
KtConstructorSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
containingClassIdIfNonLocal: Anno5
|
||||
contextReceivers: []
|
||||
hasStableParameterNames: true
|
||||
isExtension: false
|
||||
isPrimary: true
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /Anno5.s
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: false
|
||||
hasStableParameterNames: true
|
||||
isDefault: true
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
hasBackingField: true
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: KtNonConstantInitializerValue(val s: String)
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: true
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: s
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
setter: null
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
type: Anno5
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getS
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: s
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/String
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: [
|
||||
kotlin/annotation/Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
classIdIfNonLocal: Anno5
|
||||
classKind: ANNOTATION_CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isData: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Anno5
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/Annotation
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: [TYPE]
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: I
|
||||
@@ -308,4 +446,125 @@ KtNamedClassOrObjectSymbol:
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtTypeParameterSymbol:
|
||||
annotationsList: []
|
||||
isReified: false
|
||||
name: T
|
||||
origin: SOURCE
|
||||
typeParameters: []
|
||||
upperBounds: []
|
||||
variance: INVARIANT
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno5|(s = String(1)) T>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|Anno5|(s = String(1)) T
|
||||
annotationsList: [
|
||||
Anno5(s = "1")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtTypeParameterSymbol:
|
||||
annotationsList: []
|
||||
isReified: false
|
||||
name: T
|
||||
origin: SOURCE
|
||||
typeParameters: []
|
||||
upperBounds: []
|
||||
variance: INVARIANT
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /foo2
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExtension: true
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: foo2
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: []
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtFunctionSymbol(/foo2)
|
||||
type: KtTypeParameterType:
|
||||
type: T
|
||||
annotationsList: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
type: kotlin/collections/List<kotlin/collections/List<@R|Anno5|(s = String(1)) T>>?
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
type: kotlin/collections/List<@R|Anno5|(s = String(1)) T>
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtTypeParameterType:
|
||||
type: @R|Anno5|(s = String(1)) T
|
||||
annotationsList: [
|
||||
Anno5(s = "1")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
]
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: [
|
||||
KtTypeParameterSymbol(T)
|
||||
]
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
@@ -59,40 +59,60 @@ abstract class FirBasedSymbol<E : FirDeclaration> {
|
||||
|
||||
@SymbolInternals
|
||||
fun FirAnnotationContainer.resolvedCompilerRequiredAnnotations(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (annotations.isEmpty()) return emptyList()
|
||||
return annotations.resolvedCompilerRequiredAnnotations(anchorElement)
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun List<FirAnnotation>.resolvedCompilerRequiredAnnotations(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (isEmpty()) return emptyList()
|
||||
|
||||
anchorElement.lazyResolveToPhase(FirResolvePhase.COMPILER_REQUIRED_ANNOTATIONS)
|
||||
return annotations
|
||||
return this
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun FirAnnotationContainer.resolvedAnnotationsWithArguments(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (annotations.isEmpty()) return emptyList()
|
||||
return annotations.resolvedAnnotationsWithArguments(anchorElement)
|
||||
}
|
||||
|
||||
val phase = if (annotations.any { it is FirAnnotationCall && it.arguments.isNotEmpty() }) {
|
||||
@SymbolInternals
|
||||
fun List<FirAnnotation>.resolvedAnnotationsWithArguments(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (isEmpty()) return emptyList()
|
||||
|
||||
val phase = if (any { it is FirAnnotationCall && it.arguments.isNotEmpty() }) {
|
||||
FirResolvePhase.ANNOTATIONS_ARGUMENTS_MAPPING
|
||||
} else {
|
||||
FirResolvePhase.TYPES
|
||||
}
|
||||
|
||||
anchorElement.lazyResolveToPhase(phase)
|
||||
return annotations
|
||||
return this
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun FirAnnotationContainer.resolvedAnnotationsWithClassIds(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (annotations.isEmpty()) return emptyList()
|
||||
return annotations.resolvedAnnotationsWithClassIds(anchorElement)
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun List<FirAnnotation>.resolvedAnnotationsWithClassIds(anchorElement: FirBasedSymbol<*>): List<FirAnnotation> {
|
||||
if (isEmpty()) return emptyList()
|
||||
|
||||
anchorElement.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||
return annotations
|
||||
return this
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun FirAnnotationContainer.resolvedAnnotationClassIds(anchorElement: FirBasedSymbol<*>): List<ClassId> {
|
||||
if (annotations.isEmpty()) return emptyList()
|
||||
return annotations.resolvedAnnotationClassIds(anchorElement)
|
||||
}
|
||||
|
||||
@SymbolInternals
|
||||
fun List<FirAnnotation>.resolvedAnnotationClassIds(anchorElement: FirBasedSymbol<*>): List<ClassId> {
|
||||
if (isEmpty()) return emptyList()
|
||||
|
||||
anchorElement.lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||
return annotations.mapNotNull { (it.annotationTypeRef.coneType as? ConeClassLikeType)?.lookupTag?.classId }
|
||||
return mapNotNull { (it.annotationTypeRef.coneType as? ConeClassLikeType)?.lookupTag?.classId }
|
||||
}
|
||||
|
||||
@RequiresOptIn
|
||||
|
||||
Reference in New Issue
Block a user