[SR-5534] Memberwise initializers with any number of optional properties #48106
Labels
compiler
The Swift compiler in itself
duplicate
Resolution: Duplicates another issue
feature
A feature request or implementation
improvement
memberwise init
Feature: Memberwise structure initializers
swift evolution implemented
Flag → feature: A feature that was approved through the Swift evolution process and implemented
Additional Detail from JIRA
md5: f7949e46c502a72e96387d53c13e0a96
is duplicated by:
relates to:
Issue Description:
Currently, if we don't have our own initializer for the structure, its default memberwise initializer allows to provide values of all properties. If we assign a default value for all of our properties, additional initializer in shape of
init()
becomes available to use.It would be a lot more convenient to make structure initializer behave more like a function with default values.
Example:
Are there any potential problems with such behavior?
The text was updated successfully, but these errors were encountered: