[Issue 6178] Struct inside the AA are not init correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 8 03:28:16 PDT 2013


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
           Platform|x86                         |All
         OS/Version|Linux                       |All


--- Comment #21 from Kenji Hara <k.hara.pg at gmail.com> 2013-09-08 03:28:06 PDT ---
(In reply to comment #20)
> For such structs, AA value setting should do additional work to distinguish
> initializing and assignment.
> 
> struct S1 {
>     void opAssign(S1 rhs) {}
> }
> 
> S1[int] aa1;
> aa1[1] = S1();  // [*]
> 
> I think the line at [*] should behave as follows:
> 1. If the key doesn't exist in aa yet, so it should work as initializing.
> 2. If the key already exists in aa, so it should work as assignment
>    (== opAssign call).

https://github.com/D-Programming-Language/dmd/pull/2539
https://github.com/D-Programming-Language/phobos/pull/1554

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