From 5e742884ded9861b8f8195fc5a4e92c154976e87 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 4 Mar 2024 14:38:42 +0200 Subject: [PATCH] [Test] Reproduce KT-66258 --- ...cCompilerTestFE10TestdataTestGenerated.java | 6 ++++++ ...osticCompilerFE10TestDataTestGenerated.java | 6 ++++++ ...reeOldFrontendDiagnosticsTestGenerated.java | 6 ++++++ ...PsiOldFrontendDiagnosticsTestGenerated.java | 6 ++++++ .../optInDiagnosticOnPropertyGetter.fir.kt | 18 ++++++++++++++++++ .../optInDiagnosticOnPropertyGetter.kt | 18 ++++++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 ++++++ 7 files changed, 66 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.fir.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.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 c5881202a91..3e95bd4ac61 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 @@ -38245,6 +38245,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onTypeParameter.kt"); } + @Test + @TestMetadata("optInDiagnosticOnPropertyGetter.kt") + public void testOptInDiagnosticOnPropertyGetter() { + runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt"); + } + @Test @TestMetadata("suppressOnDeclarationItself.kt") public void testSuppressOnDeclarationItself() { 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 40ef863f9d3..6ef24c2686a 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 @@ -38245,6 +38245,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onTypeParameter.kt"); } + @Test + @TestMetadata("optInDiagnosticOnPropertyGetter.kt") + public void testOptInDiagnosticOnPropertyGetter() { + runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt"); + } + @Test @TestMetadata("suppressOnDeclarationItself.kt") public void testSuppressOnDeclarationItself() { 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 d2c3f46e539..1bf816f1701 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 @@ -35817,6 +35817,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onTypeParameter.kt"); } + @Test + @TestMetadata("optInDiagnosticOnPropertyGetter.kt") + public void testOptInDiagnosticOnPropertyGetter() { + runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt"); + } + @Test @TestMetadata("suppressOnDeclarationItself.kt") public void testSuppressOnDeclarationItself() { 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 c7e12261542..b7f2c53f6d5 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 @@ -35955,6 +35955,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onTypeParameter.kt"); } + @Test + @TestMetadata("optInDiagnosticOnPropertyGetter.kt") + public void testOptInDiagnosticOnPropertyGetter() { + runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt"); + } + @Test @TestMetadata("suppressOnDeclarationItself.kt") public void testSuppressOnDeclarationItself() { diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.fir.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.fir.kt new file mode 100644 index 00000000000..bbc416bd2be --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.fir.kt @@ -0,0 +1,18 @@ +// DIAGNOSTICS: -ERROR_SUPPRESSION +// WITH_STDLIB +// ISSUE: KT-66258 + +@RequiresOptIn +annotation class Ann + +class A( + @get:Ann + @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET") + val s: String +) + +class B { + @get:Ann + @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET") + val s: String = "" +} diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt new file mode 100644 index 00000000000..2ee1ba356a4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt @@ -0,0 +1,18 @@ +// DIAGNOSTICS: -ERROR_SUPPRESSION +// WITH_STDLIB +// ISSUE: KT-66258 + +@RequiresOptIn +annotation class Ann + +class A( + @get:Ann + @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET") + val s: String +) + +class B { + @get:Ann + @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET") + val s: 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 c7fbaa85f6a..c75139c5a22 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 @@ -38245,6 +38245,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onTypeParameter.kt"); } + @Test + @TestMetadata("optInDiagnosticOnPropertyGetter.kt") + public void testOptInDiagnosticOnPropertyGetter() { + runTest("compiler/testData/diagnostics/tests/suppress/oneWarning/optInDiagnosticOnPropertyGetter.kt"); + } + @Test @TestMetadata("suppressOnDeclarationItself.kt") public void testSuppressOnDeclarationItself() {