K1: don't report UNRESOLVED_WITH_TARGET on hidden setters
This commit is contained in:
committed by
teamcity
parent
00d1e46c5a
commit
e20efc1398
@@ -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<KtBinaryExpression>())
|
||||
) {
|
||||
debugInfoReporter.reportUnresolvedWithTarget(expression, target!!)
|
||||
}
|
||||
}
|
||||
} else if (!resolved && !markedWithError) {
|
||||
debugInfoReporter.reportMissingUnresolved(expression)
|
||||
|
||||
+2
-2
@@ -44,9 +44,9 @@ fun test(c: C) {
|
||||
<!DEPRECATION_ERROR!>v3<!> // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
v3 = ""
|
||||
v4
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v4<!> = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
<!UNRESOLVED_REFERENCE!>v4<!> = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
<!DEPRECATION_ERROR!>v5<!> // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v5<!> = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
<!UNRESOLVED_REFERENCE!>v5<!> = "" // DEPRECATION_ERROR in FE 1.0, see KT-48799
|
||||
v6
|
||||
v6 = ""
|
||||
}
|
||||
|
||||
+1
-1
@@ -132,5 +132,5 @@ fun use(
|
||||
ned.p = 1
|
||||
|
||||
diff.<!DEPRECATION!>p<!>
|
||||
diff.<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, DEPRECATION, UNRESOLVED_REFERENCE!>p<!> = 1
|
||||
diff.<!DEPRECATION, UNRESOLVED_REFERENCE!>p<!> = 1
|
||||
}
|
||||
|
||||
+1
-1
@@ -132,5 +132,5 @@ fun use(
|
||||
ned.p = 1
|
||||
|
||||
diff.<!DEPRECATION!>p<!>
|
||||
diff.<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, DEPRECATION, UNRESOLVED_REFERENCE!>p<!> = 1
|
||||
diff.<!DEPRECATION, UNRESOLVED_REFERENCE!>p<!> = 1
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ fun test() {
|
||||
<!DEPRECATION_ERROR!>v3<!>
|
||||
v3 = ""
|
||||
v4
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v4<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v4<!> = ""
|
||||
<!DEPRECATION_ERROR!>v5<!>
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v5<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v5<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v6<!>
|
||||
<!UNRESOLVED_REFERENCE!>v6<!> = ""
|
||||
}
|
||||
|
||||
+2
-2
@@ -39,9 +39,9 @@ fun test() {
|
||||
<!API_NOT_AVAILABLE!>v3<!>
|
||||
v3 = ""
|
||||
v4
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v4<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v4<!> = ""
|
||||
<!API_NOT_AVAILABLE!>v5<!>
|
||||
<!DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>v5<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v5<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v6<!>
|
||||
<!UNRESOLVED_REFERENCE!>v6<!> = ""
|
||||
<!API_NOT_AVAILABLE!>v7<!>
|
||||
|
||||
Reference in New Issue
Block a user