[Issue 1671] New: associative array comparison fails

Jarrett Billingsley kb3ctd2 at yahoo.com
Thu Nov 15 14:57:42 PST 2007


<d-bugmail at puremagic.com> wrote in message 
news:bug-1671-3 at http.d.puremagic.com/issues/...
> http://d.puremagic.com/issues/show_bug.cgi?id=1671
>
>           Summary: associative array comparison fails
>           Product: D
>           Version: 1.023
>          Platform: PC
>        OS/Version: Linux
>            Status: NEW
>          Severity: normal
>          Priority: P2
>         Component: DMD
>        AssignedTo: bugzilla at digitalmars.com
>        ReportedBy: diggory.hardy at gmail.com
>
>
> The final assertion in the following code fails:
>
>    char[][char] X = ['a':cast(char[])"animal", 'b':['b','u','s']];
>    char[][char] Y = ['a':cast(char[])"animal", 'b':['b','u','s']];
>    assert (X.length == Y.length);
>    assert (X.keys == Y.keys);
>    assert (X.values == Y.values);
>    //X.rehash; Y.rehash;       // doesn't make a difference
>    assert (X == Y);            // fails
>
>
> -- 
>

Is AA comparison defined as the two AAs as having the same key-value pairs? 
I don't know if it's defined at all.  I think == in the current 
implementation just sees if the two AA references point to the same AA. 




More information about the Digitalmars-d-bugs mailing list