Open
Description
Description
I was surprised to learn that Regex is not Sendable. The code below doesn't compile with Swift 6.
Reproduction
struct Parser {
private static let number = /\d+/
}
Expected behavior
I would expect this to just work. Regex is a value type. Why would it have shared mutable state?
Environment
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: x86_64-apple-macosx15.0
Additional information
No response