Skip to content

[Actor isolation] Initializers don't infer global actor isolation. #36562

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

DougGregor
Copy link
Member

Initializers within a global-actor-isolated type are not inferred to
be global-actor-isolated themselves, because that isn't generally what
one wants: usually, you want to be able to create an instance of
the type by calling the initializer from somewhere.

Within such initializers, allow access to the stored properties on
"self" regardless.

Fixes rdar://75450300.

Initializers within a global-actor-isolated type are not inferred to
be global-actor-isolated themselves, because that isn't generally what
one wants: usually, you want to be able to create an instance of
the type by calling the initializer from somewhere.

Within such initializers, allow access to the stored properties on
"self" regardless.

Fixes rdar://75450300.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit f3a26b0 into swiftlang:main Mar 24, 2021
@DougGregor DougGregor deleted the initializer-no-infer-global-actor branch March 24, 2021 15: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