Skip to content

Commit 4b7ed3e

Browse files
committed
[CS] Print all failed constraints for -debug-constraints
Even if a previous constraint has failed, continue to record another failure if `-debug-constraints` is specified.
1 parent c39c4e8 commit 4b7ed3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Sema/ConstraintSystem.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,8 +2929,12 @@ class ConstraintSystem {
29292929

29302930
/// Whether we should record the failure of a constraint.
29312931
bool shouldRecordFailedConstraint() const {
2932-
// Only record it if we don't already have a failed constraint. This avoids
2933-
// allocating unnecessary constraints.
2932+
// If we're debugging, always note a failure so we can print it out.
2933+
if (getASTContext().TypeCheckerOpts.DebugConstraintSolver)
2934+
return true;
2935+
2936+
// Otherwise, only record it if we don't already have a failed constraint.
2937+
// This avoids allocating unnecessary constraints.
29342938
return !failedConstraint;
29352939
}
29362940

0 commit comments

Comments
 (0)