@@ -887,23 +887,24 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
887887 if (Solutions.size () > 1 )
888888 filterSolutions (Solutions, /* minimize=*/ true );
889889
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:
892892 //
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.
899898 if (CS.shouldAttemptFixes ()) {
900899 if (Solutions.size () > 1 )
901900 Producer.markExhausted ();
902901
903902 if (Solutions.size () == 1 ) {
904903 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+ }
907908 }
908909 } else if (Solutions.size () != 1 ) {
909910 return failConjunction ();
@@ -1053,7 +1054,7 @@ void ConjunctionStep::SolverSnapshot::replaySolution(const Solution &solution) {
10531054
10541055 // If inference succeeded, we are done.
10551056 auto score = solution.getFixedScore ();
1056- if (score.Data [SK_Fix] == 0 )
1057+ if (score.Data [SK_Fix] == 0 && score. Data [SK_Hole] == 0 )
10571058 return ;
10581059
10591060 // If this conjunction represents a closure and inference
0 commit comments