[FIR] Rework predicates system
Now predicates are split into LookupPredicate and DeclarationPredicate hierarchies. First one allows to perform global search for declarations and second one allows to check if some declaration matches the predicate. Predicates with meta annotations are excluded from LookupPredicates, because it's impossible to create index of annotations with meta-annotations, because they can be located inside binary dependencies (so to achieve this we need to scan the whole classpath). Also only one predicate with meta-annotations is left in DeclarationPredicate hierarchy (AnnotatedWithMeta) ^KT-53874 Fixed ^KT-53590 Fixed
This commit is contained in:
committed by
Space Team
parent
7a9a71a089
commit
246dc985a6
@@ -0,0 +1,45 @@
|
||||
annotation class AllOpen
|
||||
|
||||
@AllOpen
|
||||
annotation class MyComponent
|
||||
|
||||
@MyComponent // Double-transitive annotations is supported
|
||||
annotation class OtherComponent
|
||||
|
||||
@OtherComponent
|
||||
annotation class AnotherComponent
|
||||
|
||||
@java.lang.annotation.Documented
|
||||
annotation class Documented
|
||||
|
||||
class TestWithoutAnnotations_ShouldBeFinal
|
||||
|
||||
@Documented
|
||||
class ClassWithDocumented
|
||||
|
||||
@AllOpen
|
||||
class TestAllOpen_ShouldBeOpen
|
||||
|
||||
@MyComponent
|
||||
class TestMyComponent_ShouldBeOpen
|
||||
|
||||
@OtherComponent
|
||||
class TestOtherComponent_ShouldBeOpen
|
||||
|
||||
@AnotherComponent
|
||||
class TestAnotherComponent_ShouldBeOpen
|
||||
|
||||
@MyComponent
|
||||
abstract class MyComponentBase
|
||||
|
||||
class MyComponentImpl_ShouldBeOpen : MyComponentBase() {
|
||||
fun method() {}
|
||||
}
|
||||
|
||||
final class MyComponentImpl2_ShouldBeFinal : MyComponentBase() {
|
||||
fun method() {}
|
||||
}
|
||||
|
||||
class MyComponentImpl3_ShouldBeOpen : MyComponentBase() {
|
||||
final fun method_ShouldBeFinal() {}
|
||||
}
|
||||
Reference in New Issue
Block a user