mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CS] Unify failed constraint recording
Rename `addNewFailingConstraint` to `recordFailedConstraint`, and call into it whenever a constraint fails, instead of setting `failedConstraint`. This ensures that `-debug-constraints` will always log the constraint that failed a given scope. In addition, introduce `retireFailedConstraint` to cover the common case of retiring a constraint that just failed.
This commit is contained in:
@@ -1697,11 +1697,8 @@ void ConstraintSystem::addOverloadSet(ArrayRef<Constraint *> choices,
|
||||
auto *disjunction =
|
||||
Constraint::createDisjunction(*this, choices, locator, ForgetChoice);
|
||||
addUnsolvedConstraint(disjunction);
|
||||
if (simplifyAppliedOverloads(disjunction, locator)) {
|
||||
retireConstraint(disjunction);
|
||||
if (!failedConstraint)
|
||||
failedConstraint = disjunction;
|
||||
}
|
||||
if (simplifyAppliedOverloads(disjunction, locator))
|
||||
retireFailedConstraint(disjunction);
|
||||
}
|
||||
|
||||
/// If we're resolving an overload set with a decl that has special type
|
||||
|
||||
Reference in New Issue
Block a user