Skip to content

Commit dec2f45

Browse files
committed
More thorough retry of constraints which may succeed now that fixes are allowed.
1 parent b7df1ca commit dec2f45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,8 +2045,14 @@ bool ConstraintSystem::salvage(SmallVectorImpl<Solution> &viable, Expr *expr) {
20452045
SolverState state(expr, *this, FreeTypeVariableBinding::Disallow);
20462046
state.recordFixes = true;
20472047

2048-
if (failedConstraint && simplifyConstraint(*failedConstraint) == SolutionKind::Solved)
2048+
// Retry all inactive and failed constraints
2049+
if (failedConstraint) {
2050+
addUnsolvedConstraint(failedConstraint);
20492051
failedConstraint = nullptr;
2052+
}
2053+
ActiveConstraints.splice(ActiveConstraints.end(), InactiveConstraints);
2054+
for (auto &constraint : ActiveConstraints)
2055+
constraint.setActive(true);
20502056

20512057
// Solve the system.
20522058
solve(viable);

0 commit comments

Comments
 (0)