[Issue 21012] New: [REG2.062] Array equality fails with aggregates and > 3 levels of indirection

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 5 08:28:22 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21012

          Issue ID: 21012
           Summary: [REG2.062] Array equality fails with aggregates and >
                    3 levels of indirection
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

```
struct Transaction
{
    ubyte[] hash;
}

struct Block
{
    Transaction[] txs;
}

void main ()
{
    auto mutable = [ Block.init ];
    immutable immut = [ Block.init ];
    assert(mutable == immut);
}
```

Expected: Compiles, runs, succeeds
Got:
```
bug.d(16): Error: array equality comparison type mismatch, Block[] vs
immutable(Block[])
/usr/local/opt/dmd/include/dlang/dmd/core/internal/array/equality.d(127):
Error: array equality comparison type mismatch, Transaction[] vs
immutable(Transaction[])
bug.d(16): Error: template instance
core.internal.array.equality.__equals!(Block, immutable(Block)) error
instantiating
```

According to `run.dlang.org` it was working until v2.062.0

--


More information about the Digitalmars-d-bugs mailing list