I bet that PR just uncovered another issue, and the relevant questions IMO are:
a) Why is there a cast in the 1st place? When removing the `ref`, the `-vcg-ast` output reveals a silly
inout pure nothrow @nogc @safe void locate()
{
inout(Cell)* cell = null;
this.getCell(cast(inout(Cell)*)cell);
}
b) Why aren't the 2 types equivalent, where CastExp.isLvalue() would return true? https://github.com/dlang/dmd/blob/f282f98f7b8cadd4e37fb95c78d3590756f817e7/src/dmd/expression.d#L5389
Comment #4 by kinke — 2022-07-31T15:30:53Z
... bringing us back to Max's reply that I've overlooked. ;) - Probably some missing Type.merge() somewhere, causing the missing equivalence and so the cast in the first place.
Comment #5 by maxhaton — 2022-07-31T16:28:55Z
I concur with both points
Comment #6 by robert.schadek — 2024-12-13T19:23:59Z