[Concurrency] Non-Sendable value can be accessed from Global-Actor-isolated Task And normal Task #76541
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
Non-Sendable value can be accessed from Global-Actor-isolated Task And normal Task concurrently.
Reproduction
the following code can be complied with no error/warning on swift 6 mode
Expected behavior
should not be compiled. since c would be concurrently accessed from
Task
andTask.detached
.Environment
$ swiftc --version
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0
Additional information
it seems that
let c
won't be sent into MainActor's region when capturingTask { }
The text was updated successfully, but these errors were encountered: