[Issue 17206] [Tracking] Check that opEquals and toHash are both defined or neither are defined
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 3 11:49:46 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=17206
--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Steven Schveighoffer from comment #3)
> bool[S1!true] aa2;
> aa2[S1!true("hello".idup)] = true;
> aa2[S1!true("hello".idup)] = true;
> assert(aa2.length == 1); // fails
> }
The assert isn't telling the right story, really it should be that none of the
keys are equal to each other. This is a better example:
auto s1 = S1!true("hello".idup);
auto s2 = S1!true("hello".idup);
assert(s1 == s2)
aa2[s1] = true;
aa2[s2] = true;
assert(aa2.length == 1);
--
More information about the Digitalmars-d-bugs
mailing list