-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Finish hollowing out SolverScope #76921
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
Conversation
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
@@ -1033,7 +1031,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> { | |||
private: | |||
/// Restore best and current scores as they were before conjunction. | |||
void restoreCurrentScore(const Score &solutionScore) const { | |||
CS.CurrentScore = CurrentScore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method needs to be renamed now since it no longer restores the score, only adds hole + fixes scores from the closure to indicate that the body failed to type-check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do this to make sure that we rank solutions with invalid closures appropriately and don’t produce a valid solution if a multi-statement closure failed.
} | ||
|
||
// Make sure that element is solved in isolation | ||
// by dropping all scoring information. | ||
for (unsigned i = 0; i < NumScoreKinds; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we wrap this into a “resetScore” method or something like that?
@swift-ci please clean test |
@xedin agreed on both suggestions, I'll deal with them in the next PR if you don't mind because I have a few more commits coming up already |
Sure, no worries! |
The scope now just records three things: the current number of type variables, the position in the trail, and the number of scopes seen so far.