Bug 23708 – Cannot return shared class with -preview=nosharedaccess
Status
RESOLVED
Resolution
INVALID
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-02-15T09:18:54Z
Last change time
2023-03-02T11:10:11Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Atila Neves
Comments
Comment #0 by atila.neves — 2023-02-15T09:18:54Z
class Class {}
shared(Class) fun() {
static shared Class ret;
return ret;
}
% clear && dmd -g -debug -preview=nosharedaccess d.d && ./d
% d.d(4): Error: direct access to shared `ret` is not allowed, see `core.atomic`
Comment #1 by dlang-bot — 2023-02-15T11:04:30Z
@RazvanN7 created dlang/dmd pull request #14882 "Fix Issue 23708 - Cannot return shared class with -preview=nosharedaccess" fixing this issue:
- Fix Issue 23708 - Cannot return shared class with -preview=nosharedaccess
https://github.com/dlang/dmd/pull/14882
Comment #2 by razvan.nitu1305 — 2023-03-02T11:10:11Z
This issue is invalid as per the discussion in the above PR.