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 f3c36884a75..4de7fcaa2f1 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 @@ -28548,6 +28548,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/properties/localPropertyExtensions.kt"); } + @Test + @TestMetadata("PrivateSetInSuperclass.kt") + public void testPrivateSetInSuperclass() throws Exception { + runTest("compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt"); + } + @Test @TestMetadata("protectedGetterWithPublicSetter.kt") public void testProtectedGetterWithPublicSetter() 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 517b1ef03a0..9f2a2ace372 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 @@ -28548,6 +28548,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/properties/localPropertyExtensions.kt"); } + @Test + @TestMetadata("PrivateSetInSuperclass.kt") + public void testPrivateSetInSuperclass() throws Exception { + runTest("compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt"); + } + @Test @TestMetadata("protectedGetterWithPublicSetter.kt") public void testProtectedGetterWithPublicSetter() 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 df7d196b43d..e858b924ecc 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 @@ -26548,6 +26548,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/properties/localPropertyExtensions.kt"); } + @Test + @TestMetadata("PrivateSetInSuperclass.kt") + public void testPrivateSetInSuperclass() throws Exception { + runTest("compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt"); + } + @Test @TestMetadata("protectedGetterWithPublicSetter.kt") public void testProtectedGetterWithPublicSetter() 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 7ad0050eafe..4be5b5cd54e 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 @@ -26554,6 +26554,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/properties/localPropertyExtensions.kt"); } + @Test + @TestMetadata("PrivateSetInSuperclass.kt") + public void testPrivateSetInSuperclass() throws Exception { + runTest("compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt"); + } + @Test @TestMetadata("protectedGetterWithPublicSetter.kt") public void testProtectedGetterWithPublicSetter() throws Exception { diff --git a/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.fir.kt b/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.fir.kt new file mode 100644 index 00000000000..55226e94074 --- /dev/null +++ b/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.fir.kt @@ -0,0 +1,13 @@ +// ISSUE: KT-61101 + +open class A { + var x: Int = 0 + private set +} + +class B : A() + +fun test() { + val b = B() + b.x = throw Exception() +} diff --git a/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt b/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt new file mode 100644 index 00000000000..2e4c57091cf --- /dev/null +++ b/compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt @@ -0,0 +1,13 @@ +// ISSUE: KT-61101 + +open class A { + var x: Int = 0 + private set +} + +class B : A() + +fun test() { + val b = B() + b.x = throw Exception() +} 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 b768a94b1a6..81bdcefd92d 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 @@ -28548,6 +28548,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/properties/localPropertyExtensions.kt"); } + @Test + @TestMetadata("PrivateSetInSuperclass.kt") + public void testPrivateSetInSuperclass() throws Exception { + runTest("compiler/testData/diagnostics/tests/properties/PrivateSetInSuperclass.kt"); + } + @Test @TestMetadata("protectedGetterWithPublicSetter.kt") public void testProtectedGetterWithPublicSetter() throws Exception {