https://issues.dlang.org/show_bug.cgi?id=15355
Infiltrator <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Infiltrator <[email protected]> --- This might be surprising behaviour; but I think that it fits with what the comma operator does. (a, b) gets evaluated as do a, discard, do b and return. So, in this case: (1, s2[0]) = 1 Evaluate 1 and discard just does nothing. Evaluate s2[0] and return gives us a ref to s2.y. Only then does the = 1 take effect, so we end up with (ref to s2.y) = 1. So I don't think that there is actually a problem with the operator overloading in this case. As for whether or how this quirk should be fixed, I'm afraid that I can't really say. --
