Files
Michael Gottesman 34781d85ed [region-isolation] Don't inherit actor isolation through a Sendable aggregate
A non-Sendable value projected directly out of a Sendable access base
(e.g. reading the non-Sendable field of an @unchecked Sendable struct
stored on an actor) was unconditionally inheriting the actor-instance
isolation of the underlying access base in
RegionAnalysisValueMap::getTrackableValueHelper. Because the value is
reached *through* a Sendable value, it should remain disconnected, not
actor-isolated.

Concretely, given:

    class Obj: Equatable { static func ==(lhs: Obj, rhs: Obj) -> Bool { true } }
    struct W: @unchecked Sendable { let v: Obj }
    actor A { let w = W(v: Obj()) }
    extension A: Equatable {
        static func ==(lhs: A, rhs: A) -> Bool { lhs.w.v == rhs.w.v }
    }

the projected addresses 'lhs.w.v' and 'rhs.w.v' were inferred as
'lhs'-isolated and 'rhs'-isolated, and merging them at the Obj.== apply
produced a spurious cross-isolation region-merge warning on valid code.
2026-05-31 16:29:00 -07:00
..