Thread overview
[Issue 7239] New: C style struct initialization doesn't work with aliases
Jan 06, 2012
Trass3r
Jan 06, 2012
Kenji Hara
Jan 09, 2012
Walter Bright
January 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7239

           Summary: C style struct initialization doesn't work with
                    aliases
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: mrmocool@gmx.de


--- Comment #0 from Trass3r <mrmocool@gmx.de> 2012-01-06 05:40:32 PST ---
struct vec
{
    float x,y,z,w;
    alias x r;    //! for color access
    alias y g; //! ditto
    alias z b; //! ditto
    alias w a; //! ditto
}

void main()
{
    vec a = {x: 0, g: 0, b: 0, a: 1};
}

test.d(13): Error: vec.g is not a per-instance initializable field
test.d(13): Error: g is not a field of vec
test.d(13): Error: vec.b is not a per-instance initializable field
test.d(13): Error: b is not a field of vec
test.d(13): Error: vec.a is not a per-instance initializable field
test.d(13): Error: a is not a field of vec

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7239


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-01-06 07:13:12 PST ---
D2 patch: https://github.com/D-Programming-Language/dmd/pull/611

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7239


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2012-01-08 16:27:25 PST ---
https://github.com/D-Programming-Language/dmd/commit/95a933d16e732cb8f70745a0be6eca6d06b6b6be

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

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