Skip to content

Propagate function subtype conversion information down to closure emission #71833

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

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Feb 23, 2024

Teach SILGen to try to peephole a function conversion into the emission of a closure expression, then don't actually do it. The long term plan is to actually do this, which should just be a matter of taking some of the code out of reabstraction thunk emission and using it in prolog/epilog/return emission. In the short term, the goal is just to get the conversion information down to the closure emitter so that we can see that we're erasing into an @isolated(any) type and then actually erase the closure's isolation properly instead of relying on type-based erasure, which can't handle parameter/capture isolation correctly.

Includes the commit from #71832 so that CI might succeed.

…on of

a closure expression, then don't actually do it.  The long term plan is
to actually do this, which should just be a matter of taking some of the
code out of reabstraction thunk emission and using it in prolog/epilog/return
emission.  In the short term, the goal is just to get the conversion
information down to the closure emitter so that we can see that we're
erasing into an `@isolated(any)` type and then actually erase the
closure's isolation properly instead of relying on type-based erasure,
which can't handle parameter/capture isolation correctly.
@rjmccall rjmccall requested a review from slavapestov February 23, 2024 08:13
@rjmccall rjmccall requested a review from ktoso as a code owner February 23, 2024 08:13
@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall
Copy link
Contributor Author

@swift-ci Please clean test Windows

1 similar comment
@rjmccall
Copy link
Contributor Author

@swift-ci Please clean test Windows

@rjmccall rjmccall merged commit b4a5ad2 into swiftlang:main Feb 24, 2024
@rjmccall rjmccall deleted the function-subtype-peephole-preparation branch February 24, 2024 02:43
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.

1 participant