Skip to content

Commit 32b58ca

Browse files
committed
Sema: Reset best score after applying previous conjunction solution
1 parent a908386 commit 32b58ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/CSStep.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,6 @@ bool DisjunctionStep::attempt(const DisjunctionChoice &choice) {
865865
bool ConjunctionStep::attempt(const ConjunctionElement &element) {
866866
++CS.solverState->NumConjunctionTerms;
867867

868-
// Outside or previous element score doesn't affect
869-
// subsequent elements.
870-
CS.solverState->BestScore.reset();
871-
872868
// Apply solution inferred for all the previous elements
873869
// because this element could reference declarations
874870
// established in previous element(s).
@@ -880,6 +876,10 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
880876
CS.applySolution(Solutions.pop_back_val());
881877
}
882878

879+
// Outside or previous element score doesn't affect
880+
// subsequent elements.
881+
CS.solverState->BestScore.reset();
882+
883883
// Make sure that element is solved in isolation
884884
// by dropping all scoring information.
885885
CS.CurrentScore = Score();

0 commit comments

Comments
 (0)