Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex is not Sendable #792

Open
svanimpe opened this issue Dec 11, 2024 · 0 comments
Open

Regex is not Sendable #792

svanimpe opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@svanimpe
Copy link

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

@svanimpe svanimpe added the bug Something isn't working label Dec 11, 2024
@hamishknight hamishknight transferred this issue from swiftlang/swift Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant