diff --git a/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/DebugInfoUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/DebugInfoUtil.kt index c54d98ba92e..804915bb915 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/DebugInfoUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/DebugInfoUtil.kt @@ -16,12 +16,14 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticFactory import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType import org.jetbrains.kotlin.resolve.calls.util.getResolvedCall import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContextUtils import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.tasks.isDynamic import org.jetbrains.kotlin.types.error.ErrorUtils +import org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor import org.jetbrains.kotlin.util.slicedMap.WritableSlice import java.util.HashMap @@ -172,7 +174,12 @@ object DebugInfoUtil { } if (resolved && markedWithError) { if (Errors.UNRESOLVED_REFERENCE_DIAGNOSTICS.contains(factory)) { - debugInfoReporter.reportUnresolvedWithTarget(expression, target!!) + // This check is to avoid reporting UnresolvedWithTarget on hidden setters + if (expression !is KtSimpleNameExpression || + !BasicExpressionTypingVisitor.isLValue(expression, expression.getStrictParentOfType()) + ) { + debugInfoReporter.reportUnresolvedWithTarget(expression, target!!) + } } } else if (!resolved && !markedWithError) { debugInfoReporter.reportMissingUnresolved(expression) diff --git a/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt index fc946d5de0e..210c4781fca 100644 --- a/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt +++ b/compiler/testData/diagnostics/tests/deprecated/candidateBehindHiddenPropertyAccessors.kt @@ -44,9 +44,9 @@ fun test(c: C) { v3 // DEPRECATION_ERROR in FE 1.0, see KT-48799 v3 = "" v4 - v4 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 + 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 + v5 = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799 v6 v6 = "" } diff --git a/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_after.kt b/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_after.kt index 863aeb2a2de..ec1d5bfc734 100644 --- a/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_after.kt +++ b/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_after.kt @@ -132,5 +132,5 @@ fun use( ned.p = 1 diff.p - diff.p = 1 + diff.p = 1 } diff --git a/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_before.kt b/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_before.kt index 717020d28bb..b01be538e0b 100644 --- a/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_before.kt +++ b/compiler/testData/diagnostics/tests/deprecated/deprecatedPropertyInheritance_before.kt @@ -132,5 +132,5 @@ fun use( ned.p = 1 diff.p - diff.p = 1 + diff.p = 1 } diff --git a/compiler/testData/diagnostics/tests/deprecated/hiddenPropertyAccessors.kt b/compiler/testData/diagnostics/tests/deprecated/hiddenPropertyAccessors.kt index 97bb8f0f48f..304987bb7d3 100644 --- a/compiler/testData/diagnostics/tests/deprecated/hiddenPropertyAccessors.kt +++ b/compiler/testData/diagnostics/tests/deprecated/hiddenPropertyAccessors.kt @@ -32,9 +32,9 @@ fun test() { v3 v3 = "" v4 - v4 = "" + v4 = "" v5 - v5 = "" + v5 = "" v6 v6 = "" } diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/propertyAccessors.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/propertyAccessors.kt index 827420f6753..282a724af5c 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/propertyAccessors.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/propertyAccessors.kt @@ -39,9 +39,9 @@ fun test() { v3 v3 = "" v4 - v4 = "" + v4 = "" v5 - v5 = "" + v5 = "" v6 v6 = "" v7