Bug 21793 – Cannot initialize shared member with -preview=nosharedaccess
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-02T22:26:17Z
Last change time
2021-04-03T02:33:54Z
Assigned to
No Owner
Creator
moonlightsentinel
Comments
Comment #0 by moonlightsentinel — 2021-04-02T22:26:17Z
The following code doesn't compile with -preview=nosharedaccess:
struct Child
{
this(int) shared {}
}
struct Parent
{
shared Child ch;
this(int i) shared
{
ch = shared Child(i);
}
}
Comment #1 by dlang-bot — 2021-04-03T02:33:54Z
dlang/dmd pull request #12348 "Fix 21793 - Cannot initialize shared member with -preview=nosharedaccess" was merged into master:
- 32e58278fd31b5cdf77f11e9510d63ca14084685 by MoonlightSentinel:
Fix 21793 - Cannot initialize shared member with -preview=nosharedaccess
Move the `shared` check after the `ConstructExp` lowering (which may
ignore `shared`) and allow calls to `shared` functions in `DotVarExp`'s.
https://github.com/dlang/dmd/pull/12348