www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6210] New: Associative array with array key often cannot be equated.

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

           Summary: Associative array with array key often cannot be
                    equated.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: kennytm gmail.com


--- Comment #0 from kennytm gmail.com 2011-06-24 13:31:30 PDT ---
Test case 1:
----------------------------------------
void main() {
    int[char[]] a;
    a["h"] = 1;
    assert(a == a.dup); // <-- asserts
}
----------------------------------------

Test case 2:
----------------------------------------
void main() {
    int[immutable(int)[]] a, b;
    a[[1].idup] = 1;
    b[[1].idup] = 1;
    assert(a == b); // <-- asserts
}
----------------------------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 24 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210


hsteoh quickfur.ath.cx changed:

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


--- Comment #1 from hsteoh quickfur.ath.cx 2012-03-02 19:29:48 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 next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210



--- Comment #2 from hsteoh quickfur.ath.cx 2012-12-17 13:43:42 PST ---
Hmm, the pull request fixed test case 2, but test case 1 is still failing.

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



--- Comment #3 from hsteoh quickfur.ath.cx 2013-08-13 10:30:34 PDT ---
Argh, this is caused by the stupidity of typeid(const(char)[]) using a
different hash function from typeid(char[]) and typeid(immutable(char)[]). Will
submit a pull for this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |pull


--- Comment #4 from hsteoh quickfur.ath.cx 2013-08-15 07:54:52 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2479
https://github.com/D-Programming-Language/druntime/pull/573

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210



--- Comment #5 from github-bugzilla puremagic.com 2013-08-15 09:31:29 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/b8b4726a5e9d4781c3822a483abb66e8952323a8
Subsidiary fix for issue 6210.

Add builtin typeinfo for const(char)[] so that it will use the same hash
function as char[] and string.

https://github.com/D-Programming-Language/druntime/commit/8aa3ebf8715fc6c49bedd2c0c18b92e6ed46b045
Merge pull request #573 from quickfur/issue6210

Subsidiary fix for issue 6210.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210



--- Comment #5 from github-bugzilla puremagic.com 2013-08-15 09:31:29 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/b8b4726a5e9d4781c3822a483abb66e8952323a8
Subsidiary fix for issue 6210.

Add builtin typeinfo for const(char)[] so that it will use the same hash
function as char[] and string.

https://github.com/D-Programming-Language/druntime/commit/8aa3ebf8715fc6c49bedd2c0c18b92e6ed46b045
Merge pull request #573 from quickfur/issue6210

Subsidiary fix for issue 6210.

--- Comment #6 from github-bugzilla puremagic.com 2013-08-15 09:31:31 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3e811df8a9d1839282254d403fb9129f162fbe6f
Merge pull request #2479 from quickfur/issue6210

Fix issue 6210

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6210


hsteoh quickfur.ath.cx changed:

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


--- Comment #7 from hsteoh quickfur.ath.cx 2013-08-15 09:48:41 PDT ---
Verified fixed.

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