[FIR] KT-53371, KT-53519: Fix annotations arguments mapping
See: compiler/testData/asJava/lightClasses/ AnnotatedParameterInInnerClassConstructor.kt The muted tests don't work with the (KT-53371, KT-53519)-related changes. During this test happens an attempt to access unresolved annotations via CustomAnnotationTypeAttribute. Discussion: KTIJ-23547
This commit is contained in:
@@ -17,6 +17,7 @@ enum class FirResolvePhase(val noProcessor: Boolean = false) {
|
||||
ARGUMENTS_OF_ANNOTATIONS,
|
||||
CONTRACTS,
|
||||
IMPLICIT_TYPES_BODY_RESOLVE,
|
||||
ANNOTATIONS_ARGUMENTS_MAPPING,
|
||||
EXPECT_ACTUAL_MATCHING,
|
||||
BODY_RESOLVE;
|
||||
|
||||
|
||||
@@ -43,10 +43,7 @@ abstract class FirBasedSymbol<E : FirDeclaration> {
|
||||
|
||||
val resolvedAnnotationsWithArguments: List<FirAnnotation>
|
||||
get() {
|
||||
// NB: annotation argument mapping (w/ vararg) are built/replaced during call completion, hence BODY_RESOLVE.
|
||||
// TODO(KT-53371): optimize ARGUMENTS_OF_ANNOTATIONS to build annotation argument mapping too.
|
||||
// TODO(KT-53519): Even with BODY_RESOLVE, argument mapping for annotations on [FirValueParameter] is not properly built.
|
||||
lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE)
|
||||
lazyResolveToPhase(FirResolvePhase.ANNOTATIONS_ARGUMENTS_MAPPING)
|
||||
return fir.annotations
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ abstract class FirCallableSymbol<D : FirCallableDeclaration> : FirBasedSymbol<D>
|
||||
else -> lazyResolveToPhase(FirResolvePhase.TYPES)
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String = "${this::class.simpleName} $callableId"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user