... but could optimally produce:
The default memberwise initializer behavior of Swift has at least these deficiencies (IMO):
1) Defining a custom init in a struct disables the memberwise initializer, and there is no easy way to get it back.
... so this may not work for all cases. Needs research to confirm.
Implemented as suggested.
Note that memberwise initialization cannot be used:
For nested field initialization. We are using a fallback approach and generate regular field initialization expressions here. Example: ShouldConvertC99StructInitializerInReturnStatement test.
2. When fields are initialized in a non-default order, or not all fields are initialized.
Currently, we are not using a fallback approach here (hoping that such cases will be rare enough).