It's a typo, thank you! Fixed here.
nonisolated
should mean that it's accessible from everywhere, synchronously, so we cannot put global variables there by default. A global/static let
of Sendable
type could be accessed synchronously from within the module (in line with the recent amendment to SE-0306).
Mutable state cannot be nonisolated
at all, unless we invent something like the nonisolated(unsafe)
that was part of earlier revisions of SE-0313.
Now, we could consider putting mutable global/static variables on a specific global actor. For example, we could say that unannotated global/static variables are implicitly @MainActor
, and perhaps even say that top-level code is on the main actor to reduce friction there.
Doug