@@ -887,23 +887,24 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
887
887
if (Solutions.size () > 1 )
888
888
filterSolutions (Solutions, /* minimize=*/ true );
889
889
890
- // In diagnostic mode we need to stop a conjunction
891
- // but consider it successful if there are:
890
+ // In diagnostic mode we need to stop a conjunction but consider it
891
+ // successful if there are:
892
892
//
893
- // - More than one solution for this element. Ambiguity
894
- // needs to get propagated back to the outer context
895
- // to be diagnosed.
896
- // - A single solution that requires one or more fixes,
897
- // continuing would result in more errors associated
898
- // with the failed element.
893
+ // - More than one solution for this element. Ambiguity needs to get
894
+ // propagated back to the outer context to be diagnosed.
895
+ // - A single solution that requires one or more fixes or holes, since
896
+ // continuing would result in more errors associated with the failed
897
+ // element, and we don't preserve scores across elements.
899
898
if (CS.shouldAttemptFixes ()) {
900
899
if (Solutions.size () > 1 )
901
900
Producer.markExhausted ();
902
901
903
902
if (Solutions.size () == 1 ) {
904
903
auto score = Solutions.front ().getFixedScore ();
905
- if (score.Data [SK_Fix] > 0 && !CS.isForCodeCompletion ())
906
- Producer.markExhausted ();
904
+ if (!CS.isForCodeCompletion ()) {
905
+ if (score.Data [SK_Fix] > 0 || score.Data [SK_Hole] > 0 )
906
+ Producer.markExhausted ();
907
+ }
907
908
}
908
909
} else if (Solutions.size () != 1 ) {
909
910
return failConjunction ();
@@ -1053,7 +1054,7 @@ void ConjunctionStep::SolverSnapshot::replaySolution(const Solution &solution) {
1053
1054
1054
1055
// If inference succeeded, we are done.
1055
1056
auto score = solution.getFixedScore ();
1056
- if (score.Data [SK_Fix] == 0 )
1057
+ if (score.Data [SK_Fix] == 0 && score. Data [SK_Hole] == 0 )
1057
1058
return ;
1058
1059
1059
1060
// If this conjunction represents a closure and inference
0 commit comments