As an update-to-the-update, the implementation is now in sync with the proposal. I have toolchains for macOS and Linux (Windows coming soon), if anyone wants to kick the tires:
- macOS: https://ci.swift.org/view/all/job/swift-PR-toolchain-macos/1852/artifact/branch-main/swift-PR-79983-1852-osx.tar.gz
- Ubuntu 20.04: https://download.swift.org/tmp/pull-request/79983/1332/ubuntu2004/PR-ubuntu2004.tar.gz
There are three experimental features at play here for this proposal:
-
IsolatedConformances
: allows one to define and use isolated conformances, e.g.,class MyClass: @MainActor P { }
, the main part of the proposal. -
StrictSendableMetatypes
: implements the restriction on sending metatypes in generic code. This enables just the source-breaking part of the proposal. Without it, isolated conformances are not data-race-safe, but you can try it out independently. -
UnspecifiedMeansMainActorIsolated
: this experimental feature is the subject of the ongoing review of SE-0466. When enabled, it infers@MainActor
for code that isn't explicit about its isolation. When isolated conformances are also enabled, we infer@MainActor
for any conformances in the module of@MainActor
types unless they are explicitly markednonisolated
.Doug