Thread overview
[Issue 19115] Object and Collection Initializers
Jul 24, 2018
Richard Cattermole
Jul 24, 2018
OlegZ
Dec 17, 2022
Iain Buclaw
July 24, 2018
https://issues.dlang.org/show_bug.cgi?id=19115

Richard Cattermole <alphaglosined@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined@gmail.com

--- Comment #1 from Richard Cattermole <alphaglosined@gmail.com> ---
Related struct initialization DIP[0] and its discussion[1].

We should probably wait for this DIP or "tack" support for classes on.

[0] https://github.com/dlang/DIPs/pull/71
[1] https://forum.dlang.org/post/lpixarbirhorkltaqlew@forum.dlang.org

--
July 24, 2018
https://issues.dlang.org/show_bug.cgi?id=19115

--- Comment #2 from OlegZ <black80@bk.ru> ---
struct p2 { int x, y; }
struct p3 { p2 p; alias p this; int z; }

p3 p = { x:1, y:2, z:3 }; // case (1)
// we've got error: `x` is not a member of `p3`. works only for "z" alone

// try again
p3 p = { p = { x:1, y:2 }, z:3 }; // many another errors

// try again
p3 p = { p.x:1, z:3 }; // many another errors

// try again
p3 p = { z:3 };
p.p.x = 1; // internal struct .p.
p.y = 2; // simpler .
// WOW! NO ERRORS! but looks stupid

I can see error if I try to initialize one field twice, I don't see another
errors in case (1)

assign list or initialization with list should be simpler (that means faster
parser)

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=19115

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=19115

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17871

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--