File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ GRAPH_NODE_CHANGE(AddedConstraint)
7676GRAPH_NODE_CHANGE(RemovedConstraint)
7777GRAPH_NODE_CHANGE(InferredBindings)
7878GRAPH_NODE_CHANGE(RetractedBindings)
79+ GRAPH_NODE_CHANGE(AddedLiteral)
7980GRAPH_NODE_CHANGE(RetractedLiteral)
8081GRAPH_NODE_CHANGE(RetractedDelayedBy)
8182GRAPH_NODE_CHANGE(RetractedProtocol)
Original file line number Diff line number Diff line change @@ -563,6 +563,18 @@ void SolverTrail::Change::undo(ConstraintSystem &cs) const {
563563 .Defaults .push_back (TheConstraint.Constraint );
564564 break ;
565565
566+ case ChangeKind::AddedLiteral: {
567+ auto &bindings = cg[TheConstraint.TypeVar ].getPotentialBindings ();
568+ bindings.Literals .erase (
569+ llvm::remove_if (bindings.Literals ,
570+ [&](const LiteralRequirement &literal) {
571+ return literal.getSource () ==
572+ TheConstraint.Constraint ;
573+ }),
574+ bindings.Literals .end ());
575+ break ;
576+ }
577+
566578 case ChangeKind::RetractedLiteral:
567579 cg[TheConstraint.TypeVar ].getPotentialBindings ()
568580 .inferFromLiteral (cs, TheConstraint.TypeVar ,
You can’t perform that action at this time.
0 commit comments