Skip to content

[CSSolver] Solve multi-statement closures in source order #62527

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 1 commit into from
Dec 13, 2022

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Dec 12, 2022

Currently solver picks the first conjunction it can find,
which means - the earliest resolved closure. This is not
always correct because when calls are chained closures
passed to the lower members could be resolved sooner
than the ones higher up but at the same time they depend
on types inferred from members higher in the chain.

Let's make sure that multi-statement closures are always
solved in order they appear in the AST to make sure that
types are available to members lower in the chain.

Currently solver picks the first conjunction it can find,
which means - the earliest resolved closure. This is not
always correct because when calls are chained closures
passed to the lower members could be resolved sooner
than the ones higher up but at the same time they depend
on types inferred from members higher in the chain.

Let's make sure that multi-statement closures are always
solved in order they appear in the AST to make sure that
types are available to members lower in the chain.
@xedin xedin requested a review from hborla December 12, 2022 18:58
@xedin
Copy link
Contributor Author

xedin commented Dec 12, 2022

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Dec 12, 2022

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Dec 12, 2022

@swift-ci please test macOS platform

@xedin xedin merged commit db37be9 into swiftlang:main Dec 13, 2022
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