-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SE-0326] Re-enable multi-statement closure inference by default #41730
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
[SE-0326] Re-enable multi-statement closure inference by default #41730
Conversation
The new element points to an index of a particular pattern in a pattern binding declaration.
@swift-ci please test source compatibility |
@swift-ci please test |
@swift-ci please test source compatibility |
@shahmishal FYI source compat suite is failing with |
@swift-ci please test source compatibility |
There are a couple of unrelated issues in the source compatibility suite:
|
This is going to be used by multi-statement closure inference because patterns could be declarated and referenced in the body via the associated declaration.
`one-way` constraints disable some optimizations related to component selection because they imply strict ordering. This is a problem for multi-statement closures because variable declarations could involve complex operator expressions that rely on aforementioned optimizations. In order to fix that, let's move away from solving whole pattern binding declaration into scheme that explodes such declarations into indvidual elements and inlines them into a conjunction. For example: ``` let x = 42, y = x + 1, z = (x, test()) ``` Would result in a conjunction of three elements: ``` x = 42 y = x + 1 z = (x, test()) ``` Each element is solved indepedently, which eliminates the need for `one-way` constraints and re-enables component selection optimizations.
ffe26c3
to
5e4c964
Compare
@swift-ci please test source compatibility |
This should be fixed now. |
@swift-ci please test source compatibility |
@swift-ci please test |
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.
Awesome, lgtm!
@swift-ci please test |
@swift-ci please test Linux platform |
@swift-ci please test macOS platform |
Fixes a performance regression related to
one-way
constraints and re-enablesmulti-statement closure inference by default.
The changes include:
Resolves: rdar://88205521