On Thursday, 25 August 2016 at 15:22:23 UTC, Jack Applegame wrote:
Code:union A { immutable int f; } union B { immutable int f; int e; } void main() { A a = A(1);//a = A(2); // a.f is immutable, fails to compile as expectedB b = B(1); b = B(2); // compiles!!! }It turns out that if the union contains at least one mutable member, then the entire union is considered to be mutable. It's logical, but does it meet the specs? I couldn't find description of this behavior.
This should be fixed pretty soon: https://github.com/dlang/dmd/pull/5940
