Skip to content

[CSBindings] Solver result builder transformed closures as soon as all contextual information becomes available #63677

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
merged 6 commits into from
Feb 15, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 15, 2023

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.

This information would be used to decide whether conjunction that
represents transformed closure should be delayed or not.
…nsformed closures

If a result builder transformed closure doesn't rely on any external
type information it could be solved right after it's resolved. We
determine that based on three criteria:

  - Builder type doesn't have any unresolved generic parameters;
  - Closure doesn't have any parameters;
  - The contextual result type is either concrete or opaque type.
… parameters are bound

Instead of allowing only disjunctions with no parameters, let's
use a contextual type to determine whether all of the parameters
have been inferred.
…clarations

Instead of checking that there are no references to external declarations,
let's check that all of such declarations have their types resolved.
@xedin
Copy link
Contributor Author

xedin commented Feb 15, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 15, 2023

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 15, 2023

@swift-ci please build toolchain

@xedin xedin force-pushed the dont-delay-result-builder-conjunctions branch from b5a8e6a to b84d70b Compare February 15, 2023 18:16
@xedin
Copy link
Contributor Author

xedin commented Feb 15, 2023

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants