Skip to content

[SE-0401] [5.9] Disable global actor inference from properties with property wrappers #66974

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

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jun 28, 2023

  • Explanation: Implements SE-0401, which disables global actor inference from properties with property wrappers in Swift 6 (and via an upcoming feature flag).
  • Scope: Narrow. Disables a form of global actor inference in one place, based on an upcoming feature flag.
  • Risk: Low. Only enabled with an upcoming feature flag.
  • Reviewed by: @bjhomer
  • Original pull request: Disable actor inference from property wrapper usage #63884

bjhomer and others added 6 commits June 27, 2023 19:47
In Swift 5, isolation will continue, but will now produce a warning
and a fix-it suggesting that the user add explicit isolation

(cherry picked from commit 982e14b)
…ft 5.

In many cases, the inferrence was unexpected and undesired. We shouldn't warn the user about something that is reasonably likely to be correct.

(cherry picked from commit a1ea822)
`HasMainActorWrappedProp` was testing the inference rule that a type
that uses actor-isolated property wrappers its itself isolated to that
same actor. In Swift 6, that inference has been removed, so this test
now verifies that the type is _not_ actor isolated.

(cherry picked from commit bf472c2)
This will be enabled by default in Swift 6, but can now also be enabled by passing `-enable-upcoming-feature DisableActorInferenceFromPropertyWrapperUsage` to the compiler.

(cherry picked from commit f876f26)
(cherry picked from commit 312bc78)
(cherry picked from commit 03ae003)
@DougGregor DougGregor requested a review from a team as a code owner June 28, 2023 02:49
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor changed the title Se 0401 property wrapper isolation disable [SE-0401] [5.9] Disable global actor inference from properties with property wrappers Jun 28, 2023
@DougGregor DougGregor merged commit 68932a6 into swiftlang:release/5.9 Jun 28, 2023
@DougGregor DougGregor deleted the se-0401-property-wrapper-isolation-disable branch June 28, 2023 20:49
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.

3 participants