[FIR] Complete delegate calls in default inference session
This commit is contained in:
+15
-17
@@ -61,29 +61,27 @@ abstract class AbstractManyCandidatesInferenceSession(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun completeCandidates(): List<FirResolvable> {
|
fun completeCandidates(): List<FirResolvable> {
|
||||||
fun runCompletion(constraintSystem: NewConstraintSystem, atoms: List<FirStatement>) {
|
|
||||||
components.callCompleter.completer.complete(
|
|
||||||
constraintSystem.asConstraintSystemCompleterContext(),
|
|
||||||
KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL,
|
|
||||||
atoms,
|
|
||||||
unitType
|
|
||||||
) {
|
|
||||||
postponedArgumentsAnalyzer.analyze(
|
|
||||||
constraintSystem.asPostponedArgumentsAnalyzerContext(),
|
|
||||||
it,
|
|
||||||
(atoms.first() as FirResolvable).candidate
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val resolvedCalls = partiallyResolvedCalls.map { it.first }
|
val resolvedCalls = partiallyResolvedCalls.map { it.first }
|
||||||
val commonSystem = components.inferenceComponents.createConstraintSystem().apply {
|
val commonSystem = components.inferenceComponents.createConstraintSystem().apply {
|
||||||
addOtherSystem(currentConstraintSystem)
|
addOtherSystem(currentConstraintSystem)
|
||||||
}
|
}
|
||||||
prepareForCompletion(commonSystem, resolvedCalls)
|
prepareForCompletion(commonSystem, resolvedCalls)
|
||||||
@Suppress("UNCHECKED_CAST")
|
components.inferenceComponents.withInferenceSession(DEFAULT) {
|
||||||
runCompletion(commonSystem, resolvedCalls as List<FirStatement>)
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
components.callCompleter.completer.complete(
|
||||||
|
commonSystem.asConstraintSystemCompleterContext(),
|
||||||
|
KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL,
|
||||||
|
resolvedCalls as List<FirStatement>,
|
||||||
|
unitType
|
||||||
|
) {
|
||||||
|
postponedArgumentsAnalyzer.analyze(
|
||||||
|
commonSystem.asPostponedArgumentsAnalyzerContext(),
|
||||||
|
it,
|
||||||
|
resolvedCalls.first().candidate
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
resultingConstraintSystem = commonSystem
|
resultingConstraintSystem = commonSystem
|
||||||
return resolvedCalls
|
return resolvedCalls
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// KJS_WITH_FULL_RUNTIME
|
// KJS_WITH_FULL_RUNTIME
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
|
|||||||
Reference in New Issue
Block a user