RBI allows duplicate sending in top-level code #76868
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
Region-based isolation in the Swift 6 language mode allows duplicate sending of a single non-
Sendable
value in top-level code, causing potential data races.The issue does not occur in non-top-level code (e.g., within a function body).
Reproduction
Expected behavior
The compiler should detect and diagnose a potential data race for the duplicate sending of
ns
in the top-level code.Environment
The issue occurs when Swift 6 language mode is enabled in the latest relased version of Swift (Swift version 6.0.1 (swift-6.0.1-RELEASE)) and in the latest
main
development snapshot from 2024-09-25 (Swift version 6.1-dev (LLVM 89ccf4b8a46135a, Swift 6a5ae8d)).Additional information
This issue might be related to the behavior observed in this comment to issue #74820, where a similar problem with region-based isolation in top-level code is described.
The text was updated successfully, but these errors were encountered: