@@ -530,22 +530,27 @@ StepResult DisjunctionStep::resume(bool prevFailed) {
530
530
bool DisjunctionStep::shouldSkip (const DisjunctionChoice &choice) const {
531
531
auto &ctx = CS.getASTContext ();
532
532
533
- bool attemptFixes = CS.shouldAttemptFixes ();
534
- // Enable all disabled choices in "diagnostic" mode.
535
- if (!attemptFixes && choice.isDisabled ()) {
533
+ // Never skip disjunction choices in diagnostic mode.
534
+ if (CS.shouldAttemptFixes ())
535
+ return false ;
536
+
537
+ auto skip = [&](std::string reason) -> bool {
536
538
if (CS.isDebugMode ()) {
537
539
auto &log = getDebugLogger ();
538
- log << " (skipping " ;
540
+ log << " (skipping " + reason + " " ;
539
541
choice.print (log, &ctx.SourceMgr );
540
542
log << ' \n ' ;
541
543
}
542
544
543
545
return true ;
544
- }
546
+ };
545
547
546
- // Skip unavailable overloads unless solver is in the "diagnostic" mode.
547
- if (!attemptFixes && choice.isUnavailable ())
548
- return true ;
548
+ if (choice.isDisabled ())
549
+ return skip (" disabled" );
550
+
551
+ // Skip unavailable overloads.
552
+ if (choice.isUnavailable ())
553
+ return skip (" unavailable" );
549
554
550
555
if (ctx.TypeCheckerOpts .DisableConstraintSolverPerformanceHacks )
551
556
return false ;
@@ -567,7 +572,7 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
567
572
// and there are no non-trivial function conversions.
568
573
if (score[SK_ForceUnchecked] == 0 && score[SK_Unavailable] == 0 &&
569
574
score[SK_Fix] == 0 && score[SK_FunctionConversion] == 0 )
570
- return true ;
575
+ return skip ( " generic " ) ;
571
576
}
572
577
573
578
return false ;
0 commit comments