mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #77174 from slavapestov/fix-undo-order
Sema: Undo changes in chronological order in SolverTrail::undo()
This commit is contained in:
@@ -555,12 +555,7 @@ public:
|
||||
/// \param trail The record of state changes.
|
||||
void mergeEquivalenceClasses(TypeVariableType *other,
|
||||
constraints::SolverTrail *trail) {
|
||||
// Merge the equivalence classes corresponding to these two type
|
||||
// variables. Always merge 'up' the constraint stack, because it is simpler.
|
||||
if (getID() > other->getImpl().getID()) {
|
||||
other->getImpl().mergeEquivalenceClasses(getTypeVariable(), trail);
|
||||
return;
|
||||
}
|
||||
ASSERT(getID() < other->getImpl().getID());
|
||||
|
||||
auto otherRep = other->getImpl().getRepresentative(trail);
|
||||
if (trail)
|
||||
|
||||
Reference in New Issue
Block a user