mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When a conformance becomes part of a value, and that conformance could potentially be isolated, the value cannot leave that particular isolation domain. For example, if we perform a runtime lookup for a conformance to P as part of a dynamic cast `as? any P`, the conformance to P used in the cast could be isolated. Therefore, it is not safe to transfer the resulting value to another concurrency domain. Model this in region analysis by considering whether instructions that add conformances could end up introducing isolated conformances. In such cases, merge the regions with either the isolation of the conformance itself (if known) or with the region of the task (making them task-isolated). This prevents such values from being sent. Note that `@concurrent` functions, which never dynamically execute on an actor, cannot pick up isolated conformances. Fixes issue #82550 / rdar://154437489