Dev Tools · 1h ago
Swift 6 race detection test catches silenced concurrency bugs
A developer built a test that detects data races silenced by marking structs @unchecked Sendable in Swift 6. The test creates concurrent writes to a shared mutable class, exposing races that pass normal unit tests. It provides a reliable way to catch concurrency issues that the compiler no longer flags.
Meridian48 take
This is a practical workaround for a gap in Swift's concurrency safety, but it relies on developers writing adversarial tests rather than the compiler enforcing correctness.
swift-concurrencydata-race-detection