https://issues.dlang.org/show_bug.cgi?id=19917

--- Comment #5 from [email protected] ---
Nah, I think LDC's way is fine, but it could be improved by *requiring*
(exactly) one field to be explicitly initialized - clear as day and not much
more syntax overhead:

union U {
  int i;
  float f = 1.0f;
  real r;
}

vs.

union U {
  int i = void;
  float f = 1.0f;
  real r = void;
}

and

union U {
  int i = 0;
  float f;
  real r;
}

vs.

union U {
  int i;
  float f = void;
  real r = void;
}

--

Reply via email to