From ca8cfa4596ea64a7d8ea3d7ee9df9b1c5675c17f Mon Sep 17 00:00:00 2001 From: Stanislav Ruban Date: Tue, 3 Jan 2023 19:16:50 +0200 Subject: [PATCH] KT-55335: Add diagnostics test showing that issue is fixed in K2 ^KT-55335: Fixed --- .../FirOldFrontendDiagnosticsTestGenerated.java | 6 ++++++ ...tendDiagnosticsWithLightTreeTestGenerated.java | 6 ++++++ .../annotations/InheritingAnnotationClass.fir.kt | 3 +++ .../annotations/InheritingAnnotationClass.kt | 3 +++ .../annotations/InheritingAnnotationClass.txt | 15 +++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 ++++++ 6 files changed, 39 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.txt 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 5615e3818ea..3728a679527 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 @@ -1344,6 +1344,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt"); } + @Test + @TestMetadata("InheritingAnnotationClass.kt") + public void testInheritingAnnotationClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt"); + } + @Test @TestMetadata("invalidTypesInAnnotationConstructor.kt") public void testInvalidTypesInAnnotationConstructor() throws Exception { 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 6df47289d8f..e701e5a1e6f 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 @@ -1338,6 +1338,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt"); } + @Test + @TestMetadata("InheritingAnnotationClass.kt") + public void testInheritingAnnotationClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt"); + } + @Test @TestMetadata("invalidTypesInAnnotationConstructor.kt") public void testInvalidTypesInAnnotationConstructor() throws Exception { diff --git a/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.fir.kt b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.fir.kt new file mode 100644 index 00000000000..951e527f6c9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.fir.kt @@ -0,0 +1,3 @@ +annotation class AnnKlass + +class Child : AnnKlass diff --git a/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt new file mode 100644 index 00000000000..1798ad3f306 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt @@ -0,0 +1,3 @@ +annotation class AnnKlass + +class Child : AnnKlass diff --git a/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.txt b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.txt new file mode 100644 index 00000000000..b24a9dc6c2e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.txt @@ -0,0 +1,15 @@ +package + +public final annotation class AnnKlass : kotlin.Annotation { + public constructor AnnKlass() + 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 class Child : AnnKlass { + public constructor Child() + 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/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 bf16bc1297b..e0602b98a34 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 @@ -1344,6 +1344,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt"); } + @Test + @TestMetadata("InheritingAnnotationClass.kt") + public void testInheritingAnnotationClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/InheritingAnnotationClass.kt"); + } + @Test @TestMetadata("invalidTypesInAnnotationConstructor.kt") public void testInvalidTypesInAnnotationConstructor() throws Exception {