From dcc42d66c3c08a1c96400608eb1c411ac029bac1 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 24 Dec 2021 12:56:31 +0300 Subject: [PATCH] [FE 1.0] Fix formatting in `StubTypesBasedInferenceSession` --- .../tower/StubTypesBasedInferenceSession.kt | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/StubTypesBasedInferenceSession.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/StubTypesBasedInferenceSession.kt index 3f0a7b9ce05..8eb9b72928c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/StubTypesBasedInferenceSession.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/StubTypesBasedInferenceSession.kt @@ -111,8 +111,12 @@ abstract class StubTypesBasedInferenceSession( val allCandidates = arrayListOf>() if (hasOneSuccessfulAndOneErrorCandidate) { - val goodCandidate = resolvedCallsInfo.first { it.callResolutionResult.constraintSystem.errors.isEmpty() && it.callResolutionResult.diagnostics.isEmpty() } - val badCandidate = resolvedCallsInfo.first { it.callResolutionResult.constraintSystem.errors.isNotEmpty() || it.callResolutionResult.diagnostics.isNotEmpty()} + val goodCandidate = resolvedCallsInfo.first { + it.callResolutionResult.constraintSystem.errors.isEmpty() && it.callResolutionResult.diagnostics.isEmpty() + } + val badCandidate = resolvedCallsInfo.first { + it.callResolutionResult.constraintSystem.errors.isNotEmpty() || it.callResolutionResult.diagnostics.isNotEmpty() + } for (callInfo in listOf(goodCandidate, badCandidate)) { val atomsToAnalyze = mutableListOf(callInfo.callResolutionResult) @@ -152,7 +156,11 @@ abstract class StubTypesBasedInferenceSession( ) } } else { - val commonSystem = NewConstraintSystemImpl(callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner).apply { + val commonSystem = NewConstraintSystemImpl( + callComponents.constraintInjector, + builtIns, + callComponents.kotlinTypeRefiner + ).apply { addOtherSystem(currentConstraintSystem()) } @@ -167,11 +175,13 @@ abstract class StubTypesBasedInferenceSession( } val results = allCandidates.map { it.resolutionResult } - errorCallsInfo.filter { it.callResolutionResult !in results }.mapTo(allCandidates) { ResolutionResultCallInfo(it.callResolutionResult, it.result) } + errorCallsInfo.filter { it.callResolutionResult !in results }.mapTo(allCandidates) { + ResolutionResultCallInfo(it.callResolutionResult, it.result) + } return allCandidates } - override fun computeCompletionMode(candidate: ResolutionCandidate) = null + override fun computeCompletionMode(candidate: ResolutionCandidate): ConstraintSystemCompletionMode? = null override fun resolveReceiverIndependently(): Boolean = false