From f1aaae9515403a9300d84d723515e734a77a8188 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 24 Jan 2024 13:52:34 +0100 Subject: [PATCH] K2: reorganize code in ConstraintSystemCompleter around PCLA mode --- .../inference/ConstraintSystemCompleter.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt index aedbe1646ba..79a4693f36b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt @@ -165,17 +165,14 @@ class ConstraintSystemCompleter(components: BodyResolveComponents) { analyze(it, /* withPCLASession = */ false) } ) continue - } - - // Stage 8: report "not enough information" for uninferred type variables - reportNotEnoughTypeInformation( - completionMode, topLevelAtoms, topLevelType, postponedArguments - ) - - if (completionMode == ConstraintSystemCompletionMode.PCLA_POSTPONED_CALL) { reportNotEnoughInformationForTypeVariablesRequiredForInputTypesOfLambdas( postponedArguments, topLevelType, dependencyProvider, topLevelAtoms ) + } else if (completionMode != ConstraintSystemCompletionMode.PARTIAL) { + // Stage 8: report "not enough information" for uninferred type variables + reportNotEnoughTypeInformation( + completionMode, topLevelAtoms, topLevelType, postponedArguments + ) } // Stage 9: force analysis of remaining not analyzed postponed arguments and rerun stages if there are @@ -317,8 +314,6 @@ class ConstraintSystemCompleter(components: BodyResolveComponents) { "At this stage there should be no remaining variables with proper constraints" } - if (completionMode == ConstraintSystemCompletionMode.PARTIAL || completionMode == ConstraintSystemCompletionMode.PCLA_POSTPONED_CALL) break - val variableWithConstraints = notFixedTypeVariables.getValue(variableForFixation.variable) processVariableWhenNotEnoughInformation(variableWithConstraints, topLevelAtoms) }