[FIR] fix contract violation from meta annotations
^KT-60448 Fixed
This commit is contained in:
committed by
Space Team
parent
480c794444
commit
7620289f6f
+4
-3
@@ -215,12 +215,13 @@ fun FirRegularClassSymbol?.markedWithMetaAnnotationImpl(
|
||||
session: FirSession,
|
||||
metaAnnotations: Set<AnnotationFqn>,
|
||||
includeItself: Boolean,
|
||||
visited: MutableSet<FirRegularClassSymbol>
|
||||
visited: MutableSet<FirRegularClassSymbol>,
|
||||
resolvedCompilerAnnotations: (FirRegularClassSymbol) -> List<FirAnnotation> = FirBasedSymbol<*>::resolvedCompilerAnnotationsWithClassIds,
|
||||
): Boolean {
|
||||
if (this == null) return false
|
||||
if (!visited.add(this)) return false
|
||||
if (this.classId.asSingleFqName() in metaAnnotations) return includeItself
|
||||
return this.resolvedCompilerAnnotationsWithClassIds
|
||||
return resolvedCompilerAnnotations(this)
|
||||
.mapNotNull { it.annotationTypeRef.coneTypeSafe<ConeKotlinType>()?.toRegularClassSymbol(session) }
|
||||
.any { it.markedWithMetaAnnotationImpl(session, metaAnnotations, includeItself = true, visited) }
|
||||
.any { it.markedWithMetaAnnotationImpl(session, metaAnnotations, includeItself = true, visited, resolvedCompilerAnnotations) }
|
||||
}
|
||||
|
||||
+4
-1
@@ -276,7 +276,10 @@ abstract class AbstractFirSpecificAnnotationResolveTransformer(
|
||||
}
|
||||
|
||||
private fun ConeKotlinType.markedWithMetaAnnotation(session: FirSession, metaAnnotations: Set<AnnotationFqn>): Boolean {
|
||||
return toRegularClassSymbol(session).markedWithMetaAnnotationImpl(session, metaAnnotations, includeItself = true, mutableSetOf())
|
||||
return toRegularClassSymbol(session).markedWithMetaAnnotationImpl(session, metaAnnotations, includeItself = true, mutableSetOf()) {
|
||||
computationSession.resolveAnnotationsOnAnnotationIfNeeded(it, scopeSession)
|
||||
it.annotations
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user