On Sat, Oct 3, 2020 at 11:30 PM Steven Schveighoffer via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:


"StructMemberInitializers with the NonVoidInitializer syntax appear in
the lexical order of the fields in the StructDeclaration" seems to
suggest it will not call the constructor, but instead initialize the
fields according to the list.

The fields are not a static array, so clearly it is calling the
constructor, and not initializing the fields.

I really don't think this case is in the spec.

But I know it works, for instance:

Variant v = anything;

If this required an explicit Variant constructor, it would be quite
annoying.

-Steve

Yes you are rightÂ