www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7371] New: Associative arrays as associative array keys

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7371

           Summary: Associative arrays as associative array keys
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2012-01-26 04:52:07 PST ---
D2 code:


import std.stdio;
alias bool[int] IntSet;
void main() {
    int[IntSet] aa;
    aa[[1:true, 2:true]] = true;
    IntSet is1 = [1:true];
    is1[2] = true;
    aa[is1] = 2;
    writeln(aa);
}


Output:
[[1:true, 2:true]:1, [1:true, 2:true]:2]


Expected output:
[[1:true, 2:true]:2]


This bug is almost "major".
Related to bug 3789 ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7371


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx


--- Comment #1 from hsteoh quickfur.ath.cx 2012-02-29 11:21:06 PST ---
This bug is caused by the hash value being wrongly computed when an AA literal
is used (cf bug 7512 -- unfortunately the fix for that doesn't fix this issue;
probably another bug in another override of getHash).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7371



--- Comment #2 from hsteoh quickfur.ath.cx 2012-03-02 19:29:09 PST ---
https://github.com/D-Programming-Language/druntime/pull/171

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 02 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7371


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from hsteoh quickfur.ath.cx 2012-12-17 13:45:25 PST ---
Fixed in git HEAD.

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