[NI] Add checkCanceled checks before resolving a candidate

This is an analogue that was done for old inference in CandidateResolver
This commit is contained in:
Mikhail Zarechenskiy
2019-11-20 15:23:11 +03:00
parent 63e62dcf42
commit ef567c868e
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.resolve.calls package org.jetbrains.kotlin.resolve.calls
import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
import org.jetbrains.kotlin.resolve.calls.components.CallableReferenceResolver import org.jetbrains.kotlin.resolve.calls.components.CallableReferenceResolver
import org.jetbrains.kotlin.resolve.calls.components.KotlinCallCompleter import org.jetbrains.kotlin.resolve.calls.components.KotlinCallCompleter
import org.jetbrains.kotlin.resolve.calls.components.KotlinResolutionCallbacks import org.jetbrains.kotlin.resolve.calls.components.KotlinResolutionCallbacks
@@ -45,6 +46,8 @@ class KotlinCallResolver(
collectAllCandidates: Boolean, collectAllCandidates: Boolean,
createFactoryProviderForInvoke: () -> CandidateFactoryProviderForInvoke<KotlinResolutionCandidate> createFactoryProviderForInvoke: () -> CandidateFactoryProviderForInvoke<KotlinResolutionCandidate>
): CallResolutionResult { ): CallResolutionResult {
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
kotlinCall.checkCallInvariants() kotlinCall.checkCallInvariants()
val candidateFactory = SimpleCandidateFactory( val candidateFactory = SimpleCandidateFactory(
@@ -99,6 +102,8 @@ class KotlinCallResolver(
givenCandidates: Collection<GivenCandidate>, givenCandidates: Collection<GivenCandidate>,
collectAllCandidates: Boolean collectAllCandidates: Boolean
): CallResolutionResult { ): CallResolutionResult {
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
kotlinCall.checkCallInvariants() kotlinCall.checkCallInvariants()
val candidateFactory = SimpleCandidateFactory( val candidateFactory = SimpleCandidateFactory(
callComponents, scopeTower, kotlinCall, resolutionCallbacks, callableReferenceResolver callComponents, scopeTower, kotlinCall, resolutionCallbacks, callableReferenceResolver