www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9197] New: Assigning structs with postblit to a member of another struct fails at CTFE

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9197

           Summary: Assigning structs with postblit to a member of another
                    struct fails at CTFE
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



12:48:03 PST ---
This sample:

 trusted struct U
{
    this(this)
    {
    }
}

struct InvList
{
private:
    U data;
};

static InvList ivals()
{       
    InvList list;
    //next line fails
    list.data = U.init;
    U a;
    //while this one works
    a = U.init;
    return list;
}

immutable foo = ivals();


Fails to compile with:
Error: CTFE internal error: unsupported assignment this = p
ctfe_this.d(18):        called from here: list.data.opAssign(U())
ctfe_this.d(24):        called from here: ivals()

Notice the first error without a line number.

Tested with lastest dmd from master.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 22 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9197


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker



13:22:17 PST ---
Looks I'm stuck with it in the middle of reworking the core part of new
std.uni.

My attempt to sidestep it by doing the same in constructor didn't work out.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9197


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal



04:19:37 PST ---
Lovering severity as there is a workaround to construct data with __gshared +
shared static this constructor. Not pretty but workable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 24 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9197


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



10:29:03 PDT ---
Was fixed somewhere during the 8 months since back then.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 09 2013