mirror of
https://github.com/apple/swift.git
synced 2026-03-08 18:24:30 +01:00
Previously, when generating SIL for a stored property initializer, we would
use the enclosing context's isolation rather than the property's own explicit
isolation. For example:
@MainActor
struct S {
@CustomActor var x = NS() // initializer was incorrectly MainActor-isolated
}
Now the initializer correctly uses the property's explicit @CustomActor isolation
instead of inheriting @MainActor from the struct.
This is implemented by checking for an explicit global actor isolation on the
VarDecl in SILDeclRef::getActorIsolation() before falling back to
getActorIsolationOfContext().
70 KiB
70 KiB