-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CSBindings] Detect situations when type variable bindings could be i… #20205
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
/cc @rudkx |
In the future we'd be better off merging |
@swift-ci please test |
@swift-ci please test source compatibility |
…ncomplete When `bind param` constraint is associated with a given type variable a set of bindings collected for it is potentially incomplete, because binding gathering doesn't look through related type variables. Which means that such type variable has to be de-prioritized until `bind param` constraint is resolved or there is just nothing else to try, otherwise there is a risk that solver would skip some of the valid solutions. Resolves: rdar://problem/45659733
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please smoke test compiler performance |
1 similar comment
@swift-ci please smoke test compiler performance |
|
||
// As a last resort, let's check if the bindings are | ||
// potentially incomplete, and if so, let's de-prioritize them. | ||
return x.PotentiallyIncomplete < y.PotentiallyIncomplete; |
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.
It's Yet Another ranking step for potential bindings, and I agree with you that this should be merged back with FullyBound (or something like it) at some point. If you need this PR to make progress... okay...
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 actually tried to make it so FullyBound is set when there is a bind param constraint but it breaks ordering even worse (tried a bunch of different combinations), I’m hoping to re-visit fully bound soon. Trying to unblock some code with this PR...
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.
Maybe the best possible answer here is to re-work bind param itself, so we don’t get into situations like that, or make some of the choices retry-able
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
I'll run smoke test one more time before merging, just in case... |
@swift-ci please smoke test Linux platform |
2 similar comments
@swift-ci please smoke test Linux platform |
@swift-ci please smoke test Linux platform |
…ncomplete
When
bind param
constraint is associated with a given typevariable a set of bindings collected for it is potentially
incomplete, because binding gathering doesn't look through related
type variables. Which means that such type variable has to be
de-prioritized until
bind param
constraint is resolvedor there is just nothing else to try, otherwise there is a
risk that solver would skip some of the valid solutions.
Resolves: rdar://problem/45659733