-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[CSOptimizer] Add support for opened existential arguments #83735
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
…enExistentialCallArgument` into a separate function Some of the logic of `canOpenExistentialCallArgument` has to be shared with constraint optimizer which does it's own validation and most importantly - doesn't open overload choice type. In order to share the logic between the solver and the optimizer, let's extract checking that determines whether it's possible to open existential argument into `canOpenExistentialAt`.
|
@swift-ci please test |
|
@swift-ci please test source compatibility |
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.
Is the guard let essential to the test case?
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.
Yeah, it needs to be unwrapped before passing it to test to make sure that the argument is non-optional and known in advance.
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 should note that today existential opening doesn't work for stuff like env ?? <<default>> because it currently happens in simplifyApplicableFnConstraint and at that point the argument won't be resolved. This is a bug we need to fix.
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.
ah, the issue is that test() is overloaded, I see!
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.
Yep!
|
@swift-ci please test source compatibility |
|
@swift-ci please test |
Check whether it would be possible to match a parameter type by opening an existential type of the candidate argument. Resolves: rdar://158159462
|
@swift-ci please test |
|
@swift-ci please test source compatibility |
|
@swift-ci please test Windows platform |
1 similar comment
|
@swift-ci please test Windows platform |
|
@swift-ci please test source compatibility |
|
@swift-ci please smoke test macOS platform |
Check whether it would be possible to match a parameter type
by opening an existential type of the candidate argument.
Resolves: rdar://158159462