-
Notifications
You must be signed in to change notification settings - Fork 10.5k
A simple concurrency safety breach of a var being captured by reference #76929
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
Comments
This issue seems to be related to the problem I've described on Swift Forums |
Just tested this using the latest release/6.1 snapshot. There's still no diagnostics. |
Status update after tested against the release/6.1 nightly build. For the second code snippet, now the compiler can emit a error saying "Sending 'value' risks causing data races" But for the first code snippet, the compiler still fails to produce any error. @ktoso Forgive my ignorance, but don't you agree this a particular naive bad case? |
I would argue that in most Swift Concurrency cases, from a developer's view, "a false positive" could be a better option compared to "a false negative". |
Yes, this is a data-race safety hole that needs to be fixed. It's a bug in region based isolation. |
The nightly build can now correctly emit diagnostics for the 2 code snippets in OP. Good work! |
Uh oh!
There was an error while loading. Please reload this page.
Description
The following code compiles without warnings.
But it cannot produce 200000 because of the apparent race on
value
.Also, for the following modified code, the compiler will complain "Pattern that the region based isolation checker does not understand how to check".
Reproduction
See above.
Expected behavior
Environment
Additional information
No response
The text was updated successfully, but these errors were encountered: