Skip to content

Commit 03fab67

Browse files
committed
[CSStep] Abort any binding step when constraint system is 'too complex'
Previously the "too complex" would be detected by `ComponentStep::take` but binding steps would still proceed until the producer is exhausted because it considers failure of the previous resume to be just a failed choice.
1 parent a118a5d commit 03fab67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Sema/CSStep.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ template <typename P> class BindingStep : public SolverStep {
504504

505505
public:
506506
StepResult take(bool prevFailed) override {
507+
// Before attempting the next choice, let's check whether the constraint
508+
// system is too complex already.
509+
if (CS.getExpressionTooComplex(Solutions))
510+
return done(/*isSuccess=*/false);
511+
507512
while (auto choice = Producer()) {
508513
if (shouldSkip(*choice))
509514
continue;

0 commit comments

Comments
 (0)