[Issue 6052] [CTFE] Structs elements in an array are treated like reference type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 30 17:07:07 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6052


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug at yahoo.com.au
         Resolution|                            |FIXED


--- Comment #2 from Don <clugdbug at yahoo.com.au> 2011-05-30 17:02:43 PDT ---
A related test case which also fails, but involves static arrays rather than
structs:

bool bug6052b() {
    int[][1] arr;
    int[1] z = [7];
    arr[0] = z;
    assert(arr[0][0] == 7);
    arr[0] = z;
    z[0] = 3;
    assert(arr[0][0] == 3);
    return true;
}

static assert(bug6052b());


https://github.com/D-Programming-Language/dmd/commit/bccb02ad1d8578767f99efeab4a230a229e24392

Case b:
https://github.com/D-Programming-Language/dmd/commit/2ee56a0038ccac3b2225b7feda9d69798cc203e3

D1:
https://github.com/D-Programming-Language/dmd/commit/bccb02ad1d8578767f99efeab4a230a229e24392

-- 
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