From 91aa67921416dcaf8fff76736c4c993e570c9a25 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 8 Sep 2023 14:22:14 +0200 Subject: [PATCH] K2: reproduce KT-61691 --- ...CompilerTestFE10TestdataTestGenerated.java | 6 +++++ ...sticCompilerFE10TestDataTestGenerated.java | 6 +++++ ...eeOldFrontendDiagnosticsTestGenerated.java | 6 +++++ ...siOldFrontendDiagnosticsTestGenerated.java | 6 +++++ .../AnnotatedCatchValueParameter.fir.kt | 22 +++++++++++++++++++ .../AnnotatedCatchValueParameter.kt | 22 +++++++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 +++++ 7 files changed, 74 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt 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 48029e5fb6a..a3f153f710a 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 @@ -1506,6 +1506,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt"); } + @Test + @TestMetadata("AnnotatedCatchValueParameter.kt") + public void testAnnotatedCatchValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt"); + } + @Test @TestMetadata("AnnotatedConstructor.kt") public void testAnnotatedConstructor() throws Exception { 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 34cf670cd11..69baf9e3666 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 @@ -1506,6 +1506,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt"); } + @Test + @TestMetadata("AnnotatedCatchValueParameter.kt") + public void testAnnotatedCatchValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt"); + } + @Test @TestMetadata("AnnotatedConstructor.kt") public void testAnnotatedConstructor() throws Exception { 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 23ac74c8d73..4618bcf2b9d 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 @@ -1506,6 +1506,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt"); } + @Test + @TestMetadata("AnnotatedCatchValueParameter.kt") + public void testAnnotatedCatchValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt"); + } + @Test @TestMetadata("AnnotatedConstructor.kt") public void testAnnotatedConstructor() throws Exception { 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 e651dcd04bf..ef9bda99943 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 @@ -1506,6 +1506,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt"); } + @Test + @TestMetadata("AnnotatedCatchValueParameter.kt") + public void testAnnotatedCatchValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt"); + } + @Test @TestMetadata("AnnotatedConstructor.kt") public void testAnnotatedConstructor() throws Exception { diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.fir.kt new file mode 100644 index 00000000000..8e63d125f60 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.fir.kt @@ -0,0 +1,22 @@ +// WITH_STDLIB +// ISSUE: KT-61691 + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.VALUE_PARAMETER) +annotation class FixCatchValueParameter + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.LOCAL_VARIABLE) +annotation class FixCatchLocalVariable + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.CLASS) +annotation class FixCatchClass + +fun main() { + try { + + } catch (@FixCatchLocalVariable @FixCatchValueParameter @FixCatchClass e: Throwable) { + + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt new file mode 100644 index 00000000000..2daa8d3c55b --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt @@ -0,0 +1,22 @@ +// WITH_STDLIB +// ISSUE: KT-61691 + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.VALUE_PARAMETER) +annotation class FixCatchValueParameter + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.LOCAL_VARIABLE) +annotation class FixCatchLocalVariable + +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.CLASS) +annotation class FixCatchClass + +fun main() { + try { + + } catch (@FixCatchLocalVariable @FixCatchValueParameter @FixCatchClass e: Throwable) { + + } +} 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 71bb331ed66..809a5f627b8 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 @@ -1506,6 +1506,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt"); } + @Test + @TestMetadata("AnnotatedCatchValueParameter.kt") + public void testAnnotatedCatchValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt"); + } + @Test @TestMetadata("AnnotatedConstructor.kt") public void testAnnotatedConstructor() throws Exception {