From 81a9f5654e051d3a4f6234be73237ffcba4cbc8a Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 12 Mar 2024 12:25:42 +0100 Subject: [PATCH] Tests: remove diagnostic tests which are present elsewhere - `typeParameterWithTwoBounds.kt` is already present in `diagnostics/testsWithJvmBackend/duplicateJvmSignature/erasure/`. - `clashWithCompanionObjectField.kt` is already present in `codegen/box/fieldRename/jvmFieldNoClash1.kt`. - `jvmFieldAndJavaGetter.kt` is already present in `codegen/box/jvmField/noClashWithInheritedJavaMethod.kt`. In case of two latter tests on JvmField, there's (correctly) no error reported in JVM IR, which is why those are box tests. --- ...CompilerTestFE10TestdataTestGenerated.java | 18 --------------- ...sticCompilerFE10TestDataTestGenerated.java | 18 --------------- ...eeOldFrontendDiagnosticsTestGenerated.java | 18 --------------- ...siOldFrontendDiagnosticsTestGenerated.java | 18 --------------- .../typeParameterWithTwoBounds.fir.kt | 8 ------- .../typeParameterWithTwoBounds.kt | 8 ------- .../typeParameterWithTwoBounds.txt | 17 -------------- .../clashWithCompanionObjectField.fir.kt | 8 ------- .../jvmField/clashWithCompanionObjectField.kt | 8 ------- .../clashWithCompanionObjectField.txt | 17 -------------- .../jvmFieldAndJavaGetter.fir.kt | 14 ----------- .../testsWithStdLib/jvmFieldAndJavaGetter.kt | 14 ----------- .../testsWithStdLib/jvmFieldAndJavaGetter.txt | 23 ------------------- .../test/runners/DiagnosticTestGenerated.java | 18 --------------- 14 files changed, 207 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.txt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.txt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.txt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 5e693b19c94..80aea7bdea1 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -30820,12 +30820,6 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt"); } - @Test - @TestMetadata("typeParameterWithTwoBounds.kt") - public void testTypeParameterWithTwoBounds() { - runTest("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/redeclarations/shadowedExtension") @TestDataPath("$PROJECT_ROOT") @@ -41897,12 +41891,6 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt"); } - @Test - @TestMetadata("jvmFieldAndJavaGetter.kt") - public void testJvmFieldAndJavaGetter() { - runTest("compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt"); - } - @Test @TestMetadata("kt54410.kt") public void testKt54410() { @@ -42485,12 +42473,6 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } - @Test - @TestMetadata("clashWithCompanionObjectField.kt") - public void testClashWithCompanionObjectField() { - runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt"); - } - @Test @TestMetadata("inMultiFileFacade.kt") public void testInMultiFileFacade() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 17e254abc2f..ea2e92395b5 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -30820,12 +30820,6 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt"); } - @Test - @TestMetadata("typeParameterWithTwoBounds.kt") - public void testTypeParameterWithTwoBounds() { - runTest("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/redeclarations/shadowedExtension") @TestDataPath("$PROJECT_ROOT") @@ -41897,12 +41891,6 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt"); } - @Test - @TestMetadata("jvmFieldAndJavaGetter.kt") - public void testJvmFieldAndJavaGetter() { - runTest("compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt"); - } - @Test @TestMetadata("kt54410.kt") public void testKt54410() { @@ -42485,12 +42473,6 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } - @Test - @TestMetadata("clashWithCompanionObjectField.kt") - public void testClashWithCompanionObjectField() { - runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt"); - } - @Test @TestMetadata("inMultiFileFacade.kt") public void testInMultiFileFacade() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 33a15bf8a35..37e5612df7b 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -28512,12 +28512,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt"); } - @Test - @TestMetadata("typeParameterWithTwoBounds.kt") - public void testTypeParameterWithTwoBounds() { - runTest("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/redeclarations/shadowedExtension") @TestDataPath("$PROJECT_ROOT") @@ -39463,12 +39457,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt"); } - @Test - @TestMetadata("jvmFieldAndJavaGetter.kt") - public void testJvmFieldAndJavaGetter() { - runTest("compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt"); - } - @Test @TestMetadata("kt54410.kt") public void testKt54410() { @@ -40051,12 +40039,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } - @Test - @TestMetadata("clashWithCompanionObjectField.kt") - public void testClashWithCompanionObjectField() { - runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt"); - } - @Test @TestMetadata("inMultiFileFacade.kt") public void testInMultiFileFacade() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 93c486d4f22..1a52d0cfb32 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -28524,12 +28524,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt"); } - @Test - @TestMetadata("typeParameterWithTwoBounds.kt") - public void testTypeParameterWithTwoBounds() { - runTest("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/redeclarations/shadowedExtension") @TestDataPath("$PROJECT_ROOT") @@ -39601,12 +39595,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt"); } - @Test - @TestMetadata("jvmFieldAndJavaGetter.kt") - public void testJvmFieldAndJavaGetter() { - runTest("compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt"); - } - @Test @TestMetadata("kt54410.kt") public void testKt54410() { @@ -40189,12 +40177,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } - @Test - @TestMetadata("clashWithCompanionObjectField.kt") - public void testClashWithCompanionObjectField() { - runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt"); - } - @Test @TestMetadata("inMultiFileFacade.kt") public void testInMultiFileFacade() { diff --git a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.fir.kt deleted file mode 100644 index ad354abd6b7..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface Foo -interface Bar - -fun foo(x: T): T where T: Foo, T: Bar {null!!} -fun foo(x: Foo): Foo {null!!} -fun foo(x: Bar): Bar {null!!} diff --git a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt b/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt deleted file mode 100644 index 3eba7faa832..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface Foo -interface Bar - -fun foo(x: T): T where T: Foo, T: Bar {null!!} -fun foo(x: Foo): Foo {null!!} -fun foo(x: Bar): Bar {null!!} diff --git a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.txt b/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.txt deleted file mode 100644 index da840e7e020..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.txt +++ /dev/null @@ -1,17 +0,0 @@ -package - -public fun foo(/*0*/ x: Bar): Bar -public fun foo(/*0*/ x: Foo): Foo -public fun foo(/*0*/ x: T): T where T : Bar - -public interface Bar { - 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 interface Foo { - 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/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.fir.kt deleted file mode 100644 index 6d48f4be934..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -class A { - - @JvmField val clash = 1; - - companion object { - val clash = 1; - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt deleted file mode 100644 index 68cf38def67..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt +++ /dev/null @@ -1,8 +0,0 @@ -class A { - - @JvmField val clash = 1; - - companion object { - val clash = 1; - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.txt deleted file mode 100644 index dc9e81a503f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.txt +++ /dev/null @@ -1,17 +0,0 @@ -package - -public final class A { - public constructor A() - @field:kotlin.jvm.JvmField public final val clash: kotlin.Int = 1 - 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 companion object Companion { - private constructor Companion() - public final val clash: kotlin.Int = 1 - 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/testsWithStdLib/jvmFieldAndJavaGetter.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.fir.kt deleted file mode 100644 index b54711f4edb..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// MODULE: lib -// FILE: TestA.java - -public abstract class TestA { - public abstract int getProp(); -} - -// MODULE: main(lib) -// FILE: TestB.kt - -abstract class TestB : TestA() { - @JvmField - protected var prop: Int = 0 -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt b/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt deleted file mode 100644 index b362b677351..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt +++ /dev/null @@ -1,14 +0,0 @@ -// MODULE: lib -// FILE: TestA.java - -public abstract class TestA { - public abstract int getProp(); -} - -// MODULE: main(lib) -// FILE: TestB.kt - -abstract class TestB : TestA() { - @JvmField - protected var prop: Int = 0 -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.txt b/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.txt deleted file mode 100644 index 3d3eb29dd18..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.txt +++ /dev/null @@ -1,23 +0,0 @@ -// -- Module: -- -package - -public abstract class TestA { - public constructor TestA() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun getProp(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -// -- Module:
-- -package - -public abstract class TestB : TestA { - public constructor TestB() - @field:kotlin.jvm.JvmField protected final var prop: kotlin.Int - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract override /*1*/ /*fake_override*/ fun getProp(): kotlin.Int - 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 1b98bad09f9..55b09d24f0d 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 @@ -30820,12 +30820,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/redeclarations/TypeAliasVsProperty.kt"); } - @Test - @TestMetadata("typeParameterWithTwoBounds.kt") - public void testTypeParameterWithTwoBounds() { - runTest("compiler/testData/diagnostics/tests/redeclarations/typeParameterWithTwoBounds.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/redeclarations/shadowedExtension") @TestDataPath("$PROJECT_ROOT") @@ -41897,12 +41891,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt"); } - @Test - @TestMetadata("jvmFieldAndJavaGetter.kt") - public void testJvmFieldAndJavaGetter() { - runTest("compiler/testData/diagnostics/testsWithStdLib/jvmFieldAndJavaGetter.kt"); - } - @Test @TestMetadata("kt54410.kt") public void testKt54410() { @@ -42485,12 +42473,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } - @Test - @TestMetadata("clashWithCompanionObjectField.kt") - public void testClashWithCompanionObjectField() { - runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/clashWithCompanionObjectField.kt"); - } - @Test @TestMetadata("inMultiFileFacade.kt") public void testInMultiFileFacade() {