diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 9986e6fb370..8839b64eb83 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -1193,24 +1193,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt"); } - @Test - @TestMetadata("javaRepeatable.kt") - public void testJavaRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt"); - } - - @Test - @TestMetadata("javaRepeatableRetention.kt") - public void testJavaRepeatableRetention() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt"); - } - - @Test - @TestMetadata("javaUnrepeatable.kt") - public void testJavaUnrepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt"); - } - @Test @TestMetadata("kt1860-negative.kt") public void testKt1860_negative() throws Exception { @@ -1594,12 +1576,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/annotations/options/prefix.kt"); } - @Test - @TestMetadata("repeatable.kt") - public void testRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/options/repeatable.kt"); - } - @Test @TestMetadata("retention.kt") public void testRetention() throws Exception { @@ -2109,6 +2085,34 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/annotations/repeatable") + @TestDataPath("$PROJECT_ROOT") + public class Repeatable { + @Test + public void testAllFilesPresentInRepeatable() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("javaRepeatable.kt") + public void testJavaRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt"); + } + + @Test + @TestMetadata("javaUnrepeatable.kt") + public void testJavaUnrepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt"); + } + + @Test + @TestMetadata("kotlinRepeatable.kt") + public void testKotlinRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/annotations/typeUse") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 9b2ba6465b0..ac0e56ada7d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -1193,24 +1193,6 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt"); } - @Test - @TestMetadata("javaRepeatable.kt") - public void testJavaRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt"); - } - - @Test - @TestMetadata("javaRepeatableRetention.kt") - public void testJavaRepeatableRetention() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt"); - } - - @Test - @TestMetadata("javaUnrepeatable.kt") - public void testJavaUnrepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt"); - } - @Test @TestMetadata("kt1860-negative.kt") public void testKt1860_negative() throws Exception { @@ -1594,12 +1576,6 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/annotations/options/prefix.kt"); } - @Test - @TestMetadata("repeatable.kt") - public void testRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/options/repeatable.kt"); - } - @Test @TestMetadata("retention.kt") public void testRetention() throws Exception { @@ -2109,6 +2085,34 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/annotations/repeatable") + @TestDataPath("$PROJECT_ROOT") + public class Repeatable { + @Test + public void testAllFilesPresentInRepeatable() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("javaRepeatable.kt") + public void testJavaRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt"); + } + + @Test + @TestMetadata("javaUnrepeatable.kt") + public void testJavaUnrepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt"); + } + + @Test + @TestMetadata("kotlinRepeatable.kt") + public void testKotlinRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/annotations/typeUse") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.fir.kt b/compiler/testData/diagnostics/tests/annotations/javaRepeatable.fir.kt deleted file mode 100644 index 4cee7b2a11a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FULL_JDK -// FILE: RepeatableAnnotation.java - -import java.lang.annotation.Repeatable; - -@Repeatable(RepeatableAnnotations.class) -public @interface RepeatableAnnotation { -} - -// FILE: RepeatableAnnotations.java - -public @interface RepeatableAnnotations { - RepeatableAnnotation[] value(); -} - -// FILE: RepeatableUse.kt - -// Error should be gone when Java 8 Target will be available -@RepeatableAnnotation @RepeatableAnnotation class My diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt b/compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt deleted file mode 100644 index cd4a06a23e9..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FULL_JDK -// FILE: RepeatableAnnotation.java - -import java.lang.annotation.Repeatable; - -@Repeatable(RepeatableAnnotations.class) -public @interface RepeatableAnnotation { -} - -// FILE: RepeatableAnnotations.java - -public @interface RepeatableAnnotations { - RepeatableAnnotation[] value(); -} - -// FILE: RepeatableUse.kt - -// Error should be gone when Java 8 Target will be available -@RepeatableAnnotation @RepeatableAnnotation class My diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.txt b/compiler/testData/diagnostics/tests/annotations/javaRepeatable.txt deleted file mode 100644 index 5a26d8c56e4..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatable.txt +++ /dev/null @@ -1,23 +0,0 @@ -package - -@RepeatableAnnotation @RepeatableAnnotation public final class My { - public constructor My() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@kotlin.annotation.Repeatable public final annotation class RepeatableAnnotation : kotlin.Annotation { - public constructor RepeatableAnnotation() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final annotation class RepeatableAnnotations : kotlin.Annotation { - public constructor RepeatableAnnotations(/*0*/ vararg value: RepeatableAnnotation /*kotlin.Array*/) - public final val value: kotlin.Array - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.fir.kt b/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.fir.kt deleted file mode 100644 index 7c63caeac1a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FULL_JDK -// FILE: RepeatableAnnotation.java - -import java.lang.annotation.*; - -@Repeatable(RepeatableAnnotations.class) -@Retention(RetentionPolicy.RUNTIME) -public @interface RepeatableAnnotation { -} - -// FILE: RepeatableAnnotations.java - -public @interface RepeatableAnnotations { - RepeatableAnnotation[] value(); -} - -// FILE: RepeatableUse.kt - -// Error should be gone when Java 8 Target will be available -@RepeatableAnnotation @RepeatableAnnotation class My diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt b/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt deleted file mode 100644 index 58eb8b083ea..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FULL_JDK -// FILE: RepeatableAnnotation.java - -import java.lang.annotation.*; - -@Repeatable(RepeatableAnnotations.class) -@Retention(RetentionPolicy.RUNTIME) -public @interface RepeatableAnnotation { -} - -// FILE: RepeatableAnnotations.java - -public @interface RepeatableAnnotations { - RepeatableAnnotation[] value(); -} - -// FILE: RepeatableUse.kt - -// Error should be gone when Java 8 Target will be available -@RepeatableAnnotation @RepeatableAnnotation class My diff --git a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.txt b/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.txt deleted file mode 100644 index bbb78584696..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.txt +++ /dev/null @@ -1,23 +0,0 @@ -package - -@RepeatableAnnotation @RepeatableAnnotation public final class My { - public constructor My() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -@kotlin.annotation.Repeatable @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class RepeatableAnnotation : kotlin.Annotation { - public constructor RepeatableAnnotation() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final annotation class RepeatableAnnotations : kotlin.Annotation { - public constructor RepeatableAnnotations(/*0*/ vararg value: RepeatableAnnotation /*kotlin.Array*/) - public final val value: kotlin.Array - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.fir.kt b/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.fir.kt deleted file mode 100644 index 204ca20c272..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: UnrepeatableAnnotation.java - -public @interface UnrepeatableAnnotation { - -} - -// FILE: UnrepeatableUse.kt - -@UnrepeatableAnnotation @UnrepeatableAnnotation class My \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt b/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt deleted file mode 100644 index 41d80ea806a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: UnrepeatableAnnotation.java - -public @interface UnrepeatableAnnotation { - -} - -// FILE: UnrepeatableUse.kt - -@UnrepeatableAnnotation @UnrepeatableAnnotation class My \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.txt b/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.txt deleted file mode 100644 index bb2fa91f946..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.txt +++ /dev/null @@ -1,15 +0,0 @@ -package - -@UnrepeatableAnnotation @UnrepeatableAnnotation public final class My { - public constructor My() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final annotation class UnrepeatableAnnotation : kotlin.Annotation { - public constructor UnrepeatableAnnotation() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.fir.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.fir.kt new file mode 100644 index 00000000000..a0086f35abd --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.fir.kt @@ -0,0 +1,47 @@ +// FULL_JDK +// FILE: Runtime.java + +import java.lang.annotation.*; + +@Repeatable(Runtime.Container.class) +@Retention(RetentionPolicy.RUNTIME) +public @interface Runtime { + public @interface Container { + Runtime[] value(); + } +} + +// FILE: Clazz.java + +import java.lang.annotation.*; + +@Repeatable(Clazz.Container.class) +@Retention(RetentionPolicy.CLASS) +public @interface Clazz { + public @interface Container { + Clazz[] value(); + } +} + +// FILE: Source.java + +import java.lang.annotation.*; + +@Repeatable(Source.Container.class) +@Retention(RetentionPolicy.SOURCE) +public @interface Source { + public @interface Container { + Source[] value(); + } +} + +// FILE: usage.kt + +@Runtime @Runtime +class UseRuntime + +@Clazz @Clazz +class UseClazz + +@Source @Source +class UseSource diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt new file mode 100644 index 00000000000..65de39a55e2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt @@ -0,0 +1,47 @@ +// FULL_JDK +// FILE: Runtime.java + +import java.lang.annotation.*; + +@Repeatable(Runtime.Container.class) +@Retention(RetentionPolicy.RUNTIME) +public @interface Runtime { + public @interface Container { + Runtime[] value(); + } +} + +// FILE: Clazz.java + +import java.lang.annotation.*; + +@Repeatable(Clazz.Container.class) +@Retention(RetentionPolicy.CLASS) +public @interface Clazz { + public @interface Container { + Clazz[] value(); + } +} + +// FILE: Source.java + +import java.lang.annotation.*; + +@Repeatable(Source.Container.class) +@Retention(RetentionPolicy.SOURCE) +public @interface Source { + public @interface Container { + Source[] value(); + } +} + +// FILE: usage.kt + +@Runtime @Runtime +class UseRuntime + +@Clazz @Clazz +class UseClazz + +@Source @Source +class UseSource diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.txt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.txt new file mode 100644 index 00000000000..f03aa0ca86a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.txt @@ -0,0 +1,68 @@ +package + +@kotlin.annotation.Repeatable @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class Clazz : kotlin.Annotation { + public constructor Clazz() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final annotation class Container : kotlin.Annotation { + public constructor Container(/*0*/ vararg value: Clazz /*kotlin.Array*/) + public final val value: kotlin.Array + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +@kotlin.annotation.Repeatable @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class Runtime : kotlin.Annotation { + public constructor Runtime() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final annotation class Container : kotlin.Annotation { + public constructor Container(/*0*/ vararg value: Runtime /*kotlin.Array*/) + public final val value: kotlin.Array + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +@kotlin.annotation.Repeatable @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class Source : kotlin.Annotation { + public constructor Source() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final annotation class Container : kotlin.Annotation { + public constructor Container(/*0*/ vararg value: Source /*kotlin.Array*/) + public final val value: kotlin.Array + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +@Clazz @Clazz public final class UseClazz { + public constructor UseClazz() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@Runtime @Runtime public final class UseRuntime { + public constructor UseRuntime() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@Source @Source public final class UseSource { + public constructor UseSource() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.fir.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.fir.kt new file mode 100644 index 00000000000..a2e6a6adb27 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.fir.kt @@ -0,0 +1,32 @@ +// FULL_JDK +// FILE: Runtime.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Runtime {} + +// FILE: Clazz.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.CLASS) +public @interface Clazz {} + +// FILE: Source.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.SOURCE) +public @interface Source {} + +// FILE: usage.kt + +@Runtime @Runtime +class UseRuntime + +@Clazz @Clazz +class UseClazz + +@Source @Source +class UseSource diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt new file mode 100644 index 00000000000..47bc855196a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt @@ -0,0 +1,32 @@ +// FULL_JDK +// FILE: Runtime.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Runtime {} + +// FILE: Clazz.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.CLASS) +public @interface Clazz {} + +// FILE: Source.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.SOURCE) +public @interface Source {} + +// FILE: usage.kt + +@Runtime @Runtime +class UseRuntime + +@Clazz @Clazz +class UseClazz + +@Source @Source +class UseSource diff --git a/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.txt b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.txt new file mode 100644 index 00000000000..3ad7ad8f163 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.txt @@ -0,0 +1,44 @@ +package + +@kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class Clazz : kotlin.Annotation { + public constructor Clazz() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class Runtime : kotlin.Annotation { + public constructor Runtime() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class Source : kotlin.Annotation { + public constructor Source() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@Clazz @Clazz public final class UseClazz { + public constructor UseClazz() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@Runtime @Runtime public final class UseRuntime { + public constructor UseRuntime() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@Source @Source public final class UseSource { + public constructor UseSource() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/tests/annotations/options/repeatable.fir.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.fir.kt similarity index 100% rename from compiler/testData/diagnostics/tests/annotations/options/repeatable.fir.kt rename to compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.fir.kt diff --git a/compiler/testData/diagnostics/tests/annotations/options/repeatable.kt b/compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt similarity index 100% rename from compiler/testData/diagnostics/tests/annotations/options/repeatable.kt rename to compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt diff --git a/compiler/testData/diagnostics/tests/annotations/options/repeatable.txt b/compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.txt similarity index 100% rename from compiler/testData/diagnostics/tests/annotations/options/repeatable.txt rename to compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.txt diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 5865ad20268..516031c659d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -1199,24 +1199,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt"); } - @Test - @TestMetadata("javaRepeatable.kt") - public void testJavaRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt"); - } - - @Test - @TestMetadata("javaRepeatableRetention.kt") - public void testJavaRepeatableRetention() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt"); - } - - @Test - @TestMetadata("javaUnrepeatable.kt") - public void testJavaUnrepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt"); - } - @Test @TestMetadata("kt1860-negative.kt") public void testKt1860_negative() throws Exception { @@ -1600,12 +1582,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/options/prefix.kt"); } - @Test - @TestMetadata("repeatable.kt") - public void testRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/options/repeatable.kt"); - } - @Test @TestMetadata("retention.kt") public void testRetention() throws Exception { @@ -2115,6 +2091,34 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/annotations/repeatable") + @TestDataPath("$PROJECT_ROOT") + public class Repeatable { + @Test + public void testAllFilesPresentInRepeatable() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/repeatable"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("javaRepeatable.kt") + public void testJavaRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt"); + } + + @Test + @TestMetadata("javaUnrepeatable.kt") + public void testJavaUnrepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt"); + } + + @Test + @TestMetadata("kotlinRepeatable.kt") + public void testKotlinRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/annotations/typeUse") @TestDataPath("$PROJECT_ROOT") diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 4c6cd11ca88..062d926ca60 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -1193,24 +1193,6 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt"); } - @Test - @TestMetadata("javaRepeatable.kt") - public void testJavaRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatable.kt"); - } - - @Test - @TestMetadata("javaRepeatableRetention.kt") - public void testJavaRepeatableRetention() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaRepeatableRetention.kt"); - } - - @Test - @TestMetadata("javaUnrepeatable.kt") - public void testJavaUnrepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/javaUnrepeatable.kt"); - } - @Test @TestMetadata("kt1860-negative.kt") public void testKt1860_negative() throws Exception { @@ -1594,12 +1576,6 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/annotations/options/prefix.kt"); } - @Test - @TestMetadata("repeatable.kt") - public void testRepeatable() throws Exception { - runTest("compiler/testData/diagnostics/tests/annotations/options/repeatable.kt"); - } - @Test @TestMetadata("retention.kt") public void testRetention() throws Exception { @@ -2109,6 +2085,34 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/annotations/repeatable") + @TestDataPath("$PROJECT_ROOT") + public class Repeatable { + @Test + public void testAllFilesPresentInRepeatable() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("javaRepeatable.kt") + public void testJavaRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt"); + } + + @Test + @TestMetadata("javaUnrepeatable.kt") + public void testJavaUnrepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt"); + } + + @Test + @TestMetadata("kotlinRepeatable.kt") + public void testKotlinRepeatable() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/annotations/typeUse") @TestDataPath("$PROJECT_ROOT")