Comment #0 by n8sh.secondary — 2021-06-22T11:19:46Z
Equality and hashing are inconsistent for std.container.array.Array leading to incorrect behavior when an Array is used as the key of an associative array.
---
void main()
{
import std.container.array : Array;
int[Array!int] aa;
auto a = Array!int(1, 2, 3);
aa[a] = 9;
assert(aa[a] == 9); // Passes.
auto b = Array!int(1, 2, 3);
assert(a == b); // Passes.
assert(aa[b] == 9); // Fails: range violation.
}
---
Comment #1 by dlang-bot — 2021-06-22T12:45:32Z
@n8sh created dlang/phobos pull request #8150 "std.container.array: compiler allows Array as key of associative array but this does not work properly" fixing this issue:
- Fix Issue 22065 - std.container.array: compiler allows Array as key of associative array but this does not work properly
https://github.com/dlang/phobos/pull/8150
Comment #2 by n8sh.secondary — 2021-06-29T22:44:12Z
*** This issue has been marked as a duplicate of issue 22075 ***