[Issue 9197] New: Assigning structs with postblit to a member of another struct fails at CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 22 12:48:04 PST 2012


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 at puremagic.com
        ReportedBy: dmitry.olsh at gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-12-22 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: -------


More information about the Digitalmars-d-bugs mailing list