[AllOpen] Test case to recreate open annotation member warning

The AllOpen compiler plugin opens all declarations of the annotated
class, regardless of class type. However, it only opens classes (not
interfaces, objects, enums, etc). This leads to a warning where members
of an annotation are open when annotated. Spring has many such
annotations, as it is common to create meta-annotations from the core
set of AllOpen supported annotations.

^KT-63507
This commit is contained in:
Brian Norman
2024-03-06 10:50:13 -06:00
committed by Space Team
parent 753e365c9e
commit bdaacb9427
5 changed files with 36 additions and 0 deletions
@@ -0,0 +1,9 @@
// WITH_STDLIB
// ISSUE: KT-63507
annotation class AllOpen
@AllOpen
annotation class SubComponent(
val <!NON_FINAL_MEMBER_IN_FINAL_CLASS!>scope<!>: String
)
@@ -0,0 +1,9 @@
// WITH_STDLIB
// ISSUE: KT-63507
annotation class AllOpen
@AllOpen
annotation class SubComponent(
val scope: String
)
@@ -23,6 +23,12 @@ public class DiagnosticTestForAllOpenBaseGenerated extends AbstractDiagnosticTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("allOpenOnAnnotation.kt")
public void testAllOpenOnAnnotation() {
runTest("plugins/allopen/testData/diagnostics/allOpenOnAnnotation.kt");
}
@Test
@TestMetadata("kt54260.kt")
public void testKt54260() {
@@ -23,6 +23,12 @@ public class FirLightTreeDiagnosticTestForAllOpenGenerated extends AbstractFirLi
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("allOpenOnAnnotation.kt")
public void testAllOpenOnAnnotation() {
runTest("plugins/allopen/testData/diagnostics/allOpenOnAnnotation.kt");
}
@Test
@TestMetadata("kt54260.kt")
public void testKt54260() {
@@ -23,6 +23,12 @@ public class FirPsiDiagnosticTestForAllOpenGenerated extends AbstractFirPsiDiagn
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("allOpenOnAnnotation.kt")
public void testAllOpenOnAnnotation() {
runTest("plugins/allopen/testData/diagnostics/allOpenOnAnnotation.kt");
}
@Test
@TestMetadata("kt54260.kt")
public void testKt54260() {