On Friday, 10 June 2022 at 07:46:36 UTC, Mike Parker wrote:


I think this is a case where having a warning that's on by default, and which can be explicitly disabled, is useful. "Blah blah .init blah blah. See link-to-something-in-docs. Is this what you intended?"

And it *is* documented:

Struct fields are by default initialized to whatever the Initializer for the field is, and if none is supplied, to the default initializer for the field's type.
The default initializers are evaluated at compile time.

https://dlang.org/spec/struct.html#default_struct_init

Reply via email to