Well, ok, not quite in spec: https://dlang.org/migrate-to-shared.html#shared
It marks data shared across threads - that's what it does.
> This enables static checking and sharing correctness
Maybe this sentence is broadly interpreted. I think sharing correctness is provided by ruling out possibility to confuse shared data with unshared data, which is implemented by disallowing implicit conversion between shared and unshared data, see https://dlang.org/spec/const3.html#implicit_conversions
Comment #2 by dlang-bot — 2023-03-16T13:10:41Z
@ntrel created dlang/dlang.org pull request #3556 "Fix Issue 14932 - spec does not define what shared attribute does" fixing this issue:
- Fix Issue 14932 - language spec does not define what shared does
Normal initialization of shared vars is OK.
Add atomicStore, atomicLoad example.
Add example showing casting to shared.
Mention shared globals use common storage not TLS.
https://github.com/dlang/dlang.org/pull/3556
Comment #3 by dlang-bot — 2023-03-17T21:44:19Z
dlang/dlang.org pull request #3556 "Fix Issue 14932 - spec does not define what shared attribute does" was merged into master:
- 391a00ed0f6e0795153534269dc6218c0a6179e7 by Nick Treleaven:
Fix Issue 14932 - language spec does not define what shared does
Normal initialization of shared vars is OK.
Add atomicStore, atomicLoad example.
Add example showing casting to shared.
Mention shared globals use common storage not TLS.
https://github.com/dlang/dlang.org/pull/3556