Support new repeatable annotations in kotlin-reflect

- Unwrap Kotlin-repeatable annotations (with implicit container)
- Introduce `KAnnotatedElement.findAnnotations` to find instances of
  repeated annotations

 #KT-12794
This commit is contained in:
Alexander Udalov
2021-07-24 03:33:42 +02:00
parent 67128c022a
commit 0a6d010d1c
23 changed files with 448 additions and 3 deletions
@@ -27624,6 +27624,19 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/reflection/annotations/onTypes/differentPositions.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/annotations/repeatable")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Repeatable extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInRepeatable() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/builtins")