KT-63096 [LL] Add test for using annotation from other module for compiler plugin

This commit is contained in:
Roman Golyshev
2023-11-06 18:38:21 +01:00
committed by teamcity
parent 2f50267d3f
commit 500dd20277
8 changed files with 93 additions and 2 deletions
@@ -29,7 +29,18 @@ class AdditionalMembersGenerator(session: FirSession) : FirDeclarationGeneration
private val MATERIALIZE_NAME = Name.identifier("materialize")
private val NESTED_NAME = Name.identifier("Nested")
private val PREDICATE = LookupPredicate.create { annotated("NestedClassAndMaterializeMember".fqn()) }
/**
* This annotation does not exist in 'plugin-annotations' module/jar; instead,
* it's supposed to be defined in the user's (or test case) code.
*
* We need this to test that the generation extensions and annotation resolvers
* properly work with such annotations and with the declarations marked by them.
*/
private val MY_ANNOTATION = AnnotationFqn("foo.MyAnnotation")
private val PREDICATE = LookupPredicate.create {
annotated("NestedClassAndMaterializeMember".fqn()) or annotated(MY_ANNOTATION)
}
}
private val predicateBasedProvider = session.predicateBasedProvider