www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21793] New: Cannot initialize shared member with

https://issues.dlang.org/show_bug.cgi?id=21793

          Issue ID: 21793
           Summary: Cannot initialize shared member with
                    -preview=nosharedaccess
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

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);
    }
}

--
Apr 02 2021