What's the intended way to add to add annotations ...
# compiler
j
What's the intended way to add to add annotations to a class in Fir? It appears that you can do it with
FirSupertypeGenerationExtension
but I wanted to verify if that's expected or if there are better options
Snippet of doing it with
FirSupertypeGenerationExtension
:
Copy code
public class SampleSupertypeExtension(session: FirSession) : FirSupertypeGenerationExtension(session) {
  
  override fun computeAdditionalSupertypes(
    classLikeDeclaration: FirClassLikeDeclaration,
    resolvedSupertypes: List<FirResolvedTypeRef>,
    typeResolver: TypeResolveService,
  ): List<ConeKotlinType> {
    classLikeDeclaration.replaceAnnotations(
      classLikeDeclaration.annotations + buildAnnotationCall { /* ... */ },
    )