Synthesizing default values for the memberwise initializer

This is true of the current model, although the core team was receptive to the idea of changing this in their feedback to SE-0018. If it were changed, the model would be "immutable after initialization". Assignment in the declaration would be treated as a default initialization that is not used if an initializer provides a different value for the constant.

I understand that you want to keep this proposal simple so I think it's ok to leave that enhancement off for now, but supporting this is a viable future direction.

As the author of SE-0018, I would really like to revisit the topic in a more comprehensive manner someday, but I think this is a good intermediate step that would not conflict with any direction we might eventually take. It fills an obvious gap in the current initializer synthesis and should be straightforward to implement.

3 Likes