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

--- Comment #3 from Max Samukha <[email protected]> ---
(In reply to Simen Kjaeraas from comment #2)

> The solution here would be to define the default constructor as private when
> a struct has private members. 

That would be better, but simply making the default constructor private would
outlaw other valid use cases:

struct S {
   int x;
   private int y;
   int z;
}

// partial initialization should still be allowed
S s = {1};
S s2 = {1, z: 2}; // etc

In other words, private should be the respective parameters of the default
constructor.

--

Reply via email to