Sema: Split up gatherConstraints() into gatherAllConstraints() and gatherNearbyConstraints()

The two GatherKinds no longer share any implementation, so there's
no point keeping the logic together. Doing this also allows removing
the acceptConstraintFn from gatherAllConstraints(), which further
simplifies depthFirstSearch().
This commit is contained in:
Slava Pestov
2025-01-24 14:22:01 -05:00
parent 2500c83332
commit 6d8b55a9f6
7 changed files with 38 additions and 63 deletions

View File

@@ -267,8 +267,7 @@ void ConstraintSystem::assignFixedType(TypeVariableType *typeVar, Type type,
void ConstraintSystem::addTypeVariableConstraintsToWorkList(
TypeVariableType *typeVar) {
// Activate the constraints affected by a change to this type variable.
auto gatheringKind = ConstraintGraph::GatheringKind::AllMentions;
for (auto *constraint : CG.gatherConstraints(typeVar, gatheringKind))
for (auto *constraint : CG.gatherAllConstraints(typeVar))
if (!constraint->isActive())
activateConstraint(constraint);
}