From e2d65adc7e08e60ed5245e1fb8174f3b567abadb Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Mon, 27 Nov 2017 19:52:22 +0300 Subject: [PATCH] [NI] Fix KotlinResolutionCandidate.isSuccessfull Check if ConstrainSystem has any contradiction in 'isSuccessful'. Otherwise we may erroneously think that there are some successful candidates in 'TowerResolver.SuccessfullResultCollector.pushCandidates()' and clear other unsuccessful ones (while they actually may have higher applicability). --- .../jetbrains/kotlin/resolve/calls/model/ResolutionCandidate.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionCandidate.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionCandidate.kt index 5499e110ef9..e86ae9ad79a 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionCandidate.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionCandidate.kt @@ -145,7 +145,7 @@ class KotlinResolutionCandidate( override val isSuccessful: Boolean get() { processParts(stopOnFirstError = true) - return currentApplicability.isSuccess && variableApplicability.isSuccess + return currentApplicability.isSuccess && variableApplicability.isSuccess && !getSystem().hasContradiction } override val resultingApplicability: ResolutionCandidateApplicability