diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt index 120e9840575..50000ecb273 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt @@ -61,29 +61,27 @@ abstract class AbstractManyCandidatesInferenceSession( } fun completeCandidates(): List { - fun runCompletion(constraintSystem: NewConstraintSystem, atoms: List) { - components.callCompleter.completer.complete( - constraintSystem.asConstraintSystemCompleterContext(), - KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL, - atoms, - unitType - ) { - postponedArgumentsAnalyzer.analyze( - constraintSystem.asPostponedArgumentsAnalyzerContext(), - it, - (atoms.first() as FirResolvable).candidate - ) - } - } - @Suppress("UNCHECKED_CAST") val resolvedCalls = partiallyResolvedCalls.map { it.first } val commonSystem = components.inferenceComponents.createConstraintSystem().apply { addOtherSystem(currentConstraintSystem) } prepareForCompletion(commonSystem, resolvedCalls) - @Suppress("UNCHECKED_CAST") - runCompletion(commonSystem, resolvedCalls as List) + components.inferenceComponents.withInferenceSession(DEFAULT) { + @Suppress("UNCHECKED_CAST") + components.callCompleter.completer.complete( + commonSystem.asConstraintSystemCompleterContext(), + KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL, + resolvedCalls as List, + unitType + ) { + postponedArgumentsAnalyzer.analyze( + commonSystem.asPostponedArgumentsAnalyzerContext(), + it, + resolvedCalls.first().candidate + ) + } + } resultingConstraintSystem = commonSystem return resolvedCalls } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt index 10149df4970..4a4c44d03b3 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES