Skip to content

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

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

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Oct 22, 2024

This was a loose end from my SolverScope refactoring. We would undo all fixed type variable bindings first and then undo the graph updates, because the graph updates were recorded in the wrong order with respect to type variable bindings. By refactoring the logic here a little we can undo changes in the order they were recorded, eliminating a second pass over the trail.

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.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit a7b1e78 into swiftlang:main Nov 20, 2024
5 checks passed
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