https://issues.dlang.org/show_bug.cgi?id=14107
Marco Leise <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Marco Leise <[email protected]> --- Assuming that you were expecting someone to come up with a counter case, in your case it is an either-or sort of structure and after assigning to sm, bg is invalid. Disallowing comparisons all-together means that any struct using unions needs to have its own opEquals that checks which part of the union is 'active' in each instance and compares them if needed. There are other uses of unions such as: union Color { uint c; struct { ubyte r, g, b, a; } ubyte[4] arr; } where different representations of the same data are offered and a comparison of the memory representation is correct. Having to write a comparison function for every struct that uses a color can become a chore. --
