This problem is worse than I expected. First I thought it was just a case of (val ~= 7) not returning by reference (A). Boy was I wrong.
On Win10, dmd 2.094.0, -m32, I get [2,7,11] (B) - consistent with the above.
On run.dlang.io, dmd, I get [2,11,7] (C) - also consistent with (A), but not with (B)
On Win10, dmd 2.094.0, -m64, I get [2,7,11,3] (D) - not consistent with A, B, or C, but it's what we expect.
Turns out, 2.094.0 is no longer the newest version, so I updated to 2.094.1, and I get the same behavior with both -m32 and -m64 as I used to get with -m64.
run.dlang.org reports its version as 2.093 for dmd, dmd-beta, ldc-beta and ldc, and 2.091 for dmd-nightly. ldc and ldc-beta give the expected result of [2,7,11,3].
So... it's fixed?
Comment #2 by robert.schadek — 2024-12-13T19:12:53Z