[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:
@@ -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
|
||||
)
|
||||
Generated
+6
@@ -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() {
|
||||
|
||||
+6
@@ -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() {
|
||||
|
||||
Generated
+6
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user