Skip to content

[Sema] RuntimeMetadata: Add support for mutating/async methods and functions via a thunk #62738

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 3 commits into from
Jan 3, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Dec 21, 2022

Instead of passing an unapplied reference to a (either static or instance) method,
let's form a thunk and use it to forward arguments to the underlying method invocation.

This way it's possible to get a uniform type for all instance methods that always starts
with self type and supports mutating and actor-isolated methods as well as
async functions.

@xedin xedin requested a review from hborla December 21, 2022 21:21
@xedin
Copy link
Contributor Author

xedin commented Dec 21, 2022

@swift-ci please build toolchain macOS

@xedin xedin force-pushed the runtime_attr_method_thunks branch from 8470938 to efa9b13 Compare December 22, 2022 00:06
@xedin xedin changed the title [Sema] RuntimeMetadata: Add support for mutating methods via a thunk [Sema] RuntimeMetadata: Add support for mutating/async methods and functions via a thunk Dec 22, 2022
Instead of passing an unapplied reference to a (either static or
instance) method, let's form a thunk and use it to forward arguments
to the underlying method invocation. This way it's possible to
get a uniform type for all instance methods that always starts
with `self` type and supports `mutating` methods by marking
`self` as `inout`.
…hods

Add support for global async functions and actor-isolated methods
by determining isolation context of the method attribute is associated
with and injecting try/await when appropriate.
@xedin xedin force-pushed the runtime_attr_method_thunks branch from efa9b13 to 23cf6a1 Compare December 22, 2022 00:15
@xedin
Copy link
Contributor Author

xedin commented Dec 22, 2022

@swift-ci please build toolchain macOS

@xedin
Copy link
Contributor Author

xedin commented Dec 22, 2022

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Dec 23, 2022

@swift-ci please test

@xedin xedin merged commit 1052a60 into swiftlang:main Jan 3, 2023
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