diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 843faee44ac..e6cd70932a1 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -8591,6 +8591,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt"); } + @Test + @TestMetadata("candidateBehindHiddenPropertyAccessors.kt") + public void testCandidateBehindHiddenPropertyAccessors() throws Exception { + runTest("compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt"); + } + @Test @TestMetadata("classWithCompanionObject.kt") public void testClassWithCompanionObject() throws Exception { 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 a355249c3cf..5ed4f76598b 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 @@ -8591,6 +8591,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt"); } + @Test + @TestMetadata("candidateBehindHiddenPropertyAccessors.kt") + public void testCandidateBehindHiddenPropertyAccessors() throws Exception { + runTest("compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt"); + } + @Test @TestMetadata("classWithCompanionObject.kt") public void testClassWithCompanionObject() 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 2c0a9854cd1..0fd4b9d3813 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 @@ -8591,6 +8591,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt"); } + @Test + @TestMetadata("candidateBehindHiddenPropertyAccessors.kt") + public void testCandidateBehindHiddenPropertyAccessors() throws Exception { + runTest("compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt"); + } + @Test @TestMetadata("classWithCompanionObject.kt") public void testClassWithCompanionObject() throws Exception { diff --git a/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.fir.kt b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.fir.kt new file mode 100644 index 00000000000..f6137a26644 --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.fir.kt @@ -0,0 +1,53 @@ +class C { + val v1: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + + @Deprecated("", level = DeprecationLevel.HIDDEN) + val v2 = "" + + var v3: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + set(value) {} + + var v4: String + get() = "" + @Deprecated("", level = DeprecationLevel.HIDDEN) + set(value) { + } + + var v5: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + @Deprecated("", level = DeprecationLevel.HIDDEN) + set(value) { + } + + @Deprecated("", level = DeprecationLevel.HIDDEN) + var v6: String + get() = "" + set(value) {} +} + +val v1: String = "" +val v2: String = "" +var v3: String = "" +var v4: String = "" +var v5: String = "" +var v6: String = "" + +fun test(c: C) { + with (c) { + v1 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v2 + v3 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v3 = "" + v4 + v4 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v5 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v5 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v6 + v6 = "" + } +} diff --git a/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt new file mode 100644 index 00000000000..325e585b60d --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt @@ -0,0 +1,53 @@ +class C { + val v1: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + + @Deprecated("", level = DeprecationLevel.HIDDEN) + val v2 = "" + + var v3: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + set(value) {} + + var v4: String + get() = "" + @Deprecated("", level = DeprecationLevel.HIDDEN) + set(value) { + } + + var v5: String + @Deprecated("", level = DeprecationLevel.HIDDEN) + get() = "" + @Deprecated("", level = DeprecationLevel.HIDDEN) + set(value) { + } + + @Deprecated("", level = DeprecationLevel.HIDDEN) + var v6: String + get() = "" + set(value) {} +} + +val v1: String = "" +val v2: String = "" +var v3: String = "" +var v4: String = "" +var v5: String = "" +var v6: String = "" + +fun test(c: C) { + with (c) { + v1 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v2 + v3 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v3 = "" + v4 + v4 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v5 // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v5 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 + v6 + v6 = "" + } +} diff --git a/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.txt b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.txt new file mode 100644 index 00000000000..074fa2587bf --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.txt @@ -0,0 +1,22 @@ +package + +public val v1: kotlin.String = "" +public val v2: kotlin.String = "" +public var v3: kotlin.String +public var v4: kotlin.String +public var v5: kotlin.String +public var v6: kotlin.String +public fun test(/*0*/ c: C): kotlin.Unit + +public final class C { + public constructor C() + @get:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final val v1: kotlin.String + @kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final val v2: kotlin.String = "" + @get:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final var v3: kotlin.String + @set:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final var v4: kotlin.String + @get:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") @set:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final var v5: kotlin.String + @kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final var v6: kotlin.String + 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 dde9e34c310..7bc73d1028f 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 @@ -8597,6 +8597,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt"); } + @Test + @TestMetadata("candidateBehindHiddenPropertyAccessors.kt") + public void testCandidateBehindHiddenPropertyAccessors() throws Exception { + runTest("compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt"); + } + @Test @TestMetadata("classWithCompanionObject.kt") public void testClassWithCompanionObject() throws Exception {