D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1671 - associative array comparison fails
Summary: associative array comparison fails
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2007-11-15 11:22 UTC by Diggory
Modified: 2014-02-24 15:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Diggory 2007-11-15 11:22:35 UTC
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
Comment 1 Nick Sabalausky 2009-04-23 22:52:27 UTC
Simpler example:

assert([1:1] == [1:1]); // Fails
Comment 2 Don 2010-05-31 12:03:52 UTC
Fixed DMD 1.057 and 2.041.