Bug 21012 – [REG2.062] Array equality fails with aggregates and > 3 levels of indirection

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-05T08:28:22Z
Last change time
2020-07-05T11:38:24Z
Assigned to
No Owner
Creator
Mathias LANG

Comments

Comment #0 by pro.mathias.lang — 2020-07-05T08:28:22Z
``` 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
Comment #1 by moonlightsentinel — 2020-07-05T11:38:24Z
Already fixed in master, bisection points to this PR https://github.com/dlang/dmd/pull/11212