digitalmars.D.bugs - [Issue 1671] New: associative array comparison fails
- d-bugmail puremagic.com (21/21) Nov 15 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1671
- Jarrett Billingsley (5/26) Nov 15 2007 Is AA comparison defined as the two AAs as having the same key-value pai...
- d-bugmail puremagic.com (5/5) Apr 23 2009 http://d.puremagic.com/issues/show_bug.cgi?id=1671
- d-bugmail puremagic.com (12/12) May 31 2010 http://d.puremagic.com/issues/show_bug.cgi?id=1671
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 digitalmars.com
ReportedBy: diggory.hardy 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
--
Nov 15 2007
<d-bugmail puremagic.com> wrote in message
news:bug-1671-3 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 digitalmars.com
ReportedBy: diggory.hardy 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.
Nov 15 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1671 Simpler example: assert([1:1] == [1:1]); // Fails --
Apr 23 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1671
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |clugdbug yahoo.com.au
Resolution| |FIXED
Fixed DMD 1.057 and 2.041.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 31 2010









"Jarrett Billingsley" <kb3ctd2 yahoo.com> 