Skip to content

[5.8][CSBindings] Solver result builder transformed closures as soon as al… #63756

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 17, 2023

…l contextual information becomes available

Cherry-pick of #63677


  • Explanation:

Improves performance when expressions have both single-statement closures
and result builder transformed closures by solving the latter independently from
the former when possible.

We determine that based on four criteria:

  • Builder type doesn't have any unresolved generic parameters;
  • Contextual type associated with the closure doesn't have any
    unresolved type variables (which means that all possible contextual information is provided to the body);
  • All of the references to declarations from outer scope are resolved (i.e. a variable declaration from a parent closure);
  • The contextual result type is either fully resolved or opaque type.

If all the criteria a met the conjunction that represents a closure is going to be
picked and solved as the next solver step.

Resolves: rdar://104645543

(cherry picked from commit f27369d)
(cherry picked from commit a815de7)
(cherry picked from commit 38f8be1)
(cherry picked from commit 5bb9d75)
(cherry picked from commit fda7530)
(cherry picked from commit b84d70b)

…l contextual information becomes available

We determine that based on four criteria:

- Builder type doesn't have any unresolved generic parameters;
- Contextual type associated with the closure doesn't have any unresolved type variables (which means that all possible contextual information is provided to the body);
- All of the references to declarations from outer scope are resolved (i.e. a variable declaration from a parent closure);
- The contextual result type is either fully resolved or opaque type.

If all the criteria a met the conjunction that represents a closure is going to be picked and solved as the next solver step.

Resolves: rdar://104645543

(cherry picked from commit f27369d)
(cherry picked from commit a815de7)
(cherry picked from commit 38f8be1)
(cherry picked from commit 5bb9d75)
(cherry picked from commit fda7530)
(cherry picked from commit b84d70b)
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.8 labels Feb 17, 2023
@xedin xedin requested a review from a team as a code owner February 17, 2023 19:28
@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2023

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2023

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 18, 2023

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 18, 2023

@swift-ci please test source compatibility

@hborla hborla merged commit b2641d6 into swiftlang:release/5.8 Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants