Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sema: Undo changes in chronological order in SolverTrail::undo() #77174

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

slavapestov
Copy link
Contributor

This was a loose end from my SolverScope refactoring.

void ConstraintGraphNode::reintroduceToInference(Constraint *constraint) {
retractFromInference(constraint);
introduceToInference(constraint);
void ConstraintGraphNode::retractFromInference(Type fixedType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the logic in retractFromInference(Type) and introduceToInference could be unified into a method i.e. updateAfterBind` that would accept a callback that either introduces or retracts constraints...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I feel like dealing with constraints after binding a type variable is an overkill, we might get away with keeping the set as is but using simplifyType during BindingSet construction because all of the logic to compute flags (i.e. pontential incomplete, literal, delayed etc.) moved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants