Summary: Problem with associative array with array of array as
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from 2011-07-05 10:43:33 PDT ---
This program:

static immutable(char[][]) toConstMatrix(char[][] M) {
    immutable(char[])[] result;
    foreach (row; M)
        result ~= row.idup;
    return result;
void main() {
    char[][] M = [" ".dup, " ".dup, " ".dup, " ".dup, " ".dup];
    auto a = toConstMatrix(M);
    auto b = toConstMatrix(M);
    bool[char[][]] foo;
    foo[a] = true;
    assert(a == b, "a != b");
    assert(a in foo, "a not in foo");
    assert(b in foo, "b not in foo");

DMD 2.053 gives:

core.exception.AssertError@test.d(15): b not in foo

But I think the hash of a dynamic array of a dynamic array has to be computed
on just the contents (and lengths) of the arrays.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to