Minor. Rename and add kdoc for Candidate::onCompletionResultsWritingCallbacks

This commit is contained in:
Denis.Zharkov
2024-02-07 15:17:44 +01:00
committed by Space Team
parent 4a74498be7
commit 05b5cdc918
3 changed files with 8 additions and 3 deletions
@@ -115,9 +115,14 @@ class Candidate(
var functionTypesOfSamConversions: HashMap<FirExpression, ConeKotlinType>? = null var functionTypesOfSamConversions: HashMap<FirExpression, ConeKotlinType>? = null
lateinit var typeArgumentMapping: TypeArgumentMapping lateinit var typeArgumentMapping: TypeArgumentMapping
val postponedAtoms = mutableListOf<PostponedResolvedAtom>() val postponedAtoms = mutableListOf<PostponedResolvedAtom>()
// PCLA-related parts
val postponedPCLACalls = mutableListOf<FirStatement>() val postponedPCLACalls = mutableListOf<FirStatement>()
val lambdasAnalyzedWithPCLA = mutableListOf<FirAnonymousFunction>() val lambdasAnalyzedWithPCLA = mutableListOf<FirAnonymousFunction>()
val onCompletionResultsWritingCallbacks = mutableListOf<(ConeSubstitutor) -> Unit>()
// Currently, it's only about completion results writing for property delegation inference info
// See the call sites of [FirDelegatedPropertyInferenceSession.completeSessionOrPostponeIfNonRoot]
val onPCLACompletionResultsWritingCallbacks = mutableListOf<(ConeSubstitutor) -> Unit>()
var currentApplicability = CandidateApplicability.RESOLVED var currentApplicability = CandidateApplicability.RESOLVED
private set private set
@@ -123,7 +123,7 @@ class FirPCLAInferenceSession(
) { ) {
outerCandidate.postponedPCLACalls += childCalls outerCandidate.postponedPCLACalls += childCalls
currentCommonSystem.addOtherSystem(childStorage) currentCommonSystem.addOtherSystem(childStorage)
outerCandidate.onCompletionResultsWritingCallbacks += onCompletionResultsWriting outerCandidate.onPCLACompletionResultsWritingCallbacks += onCompletionResultsWriting
} }
private fun FirExpression.updateReturnTypeWithCurrentSubstitutor( private fun FirExpression.updateReturnTypeWithCurrentSubstitutor(
@@ -194,7 +194,7 @@ class FirCallCompletionResultsWriterTransformer(
postponedCall.transformSingle(this, null) postponedCall.transformSingle(this, null)
} }
for (callback in candidate.onCompletionResultsWritingCallbacks) { for (callback in candidate.onPCLACompletionResultsWritingCallbacks) {
callback(finalSubstitutor) callback(finalSubstitutor)
} }