-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Hole in region checker when bundling non-Sendable into an array. #89134
Copy link
Copy link
Open
Labels
actor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresregion-based isolation checker
Metadata
Metadata
Assignees
Labels
actor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresregion-based isolation checker
Description
If you pass an array of a non-
Sendableobject to an actor initializer, the object is not isolated to the actor's region. Same happens with dictionaries and sets.This only seems to affect Xcode versions of Swift. I could not reproduce this on any version of Swift since 6.0.3 in godbolt: https://godbolt.org/z/xP1KGdfTE
Reproduction
Expected behavior
Compiler should reject code since we are accessing
nsafter it has been sent to the actor.Environment
swift-driver version: 1.148.6 Apple Swift version 6.3.2 (swiftlang-6.3.2.1.103 clang-2100.1.1.101)
Target: arm64-apple-macosx26.0
Additional information
No response