-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible memberwise initialization #76
Flexible memberwise initialization #76
Conversation
|
||
2. Sometimes mutable properties that have a sensible default value are simply default-initialized and the same post-initialization configuration strategy is employed when the default value is not correct for the intended use. This results in an instance which may pass through several states that are incorrect *for the intended use* before it is correctly initialized for its intended use. | ||
|
||
Underlying this problem is the fact initialization scales with M x N complexity (M members, N initializers). We need as much help from the compiler as we can get! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Shouldn't this be the following?
“Underlying this problem is the fact that initialization scales...”
Looks good, please squash it into one patch and I'll commit it! |
added example for lazy properties correct typos and small omissions added link to Swift Evolution thread fix initialzier typo Significant rewrite The programmer and implementation models have received major revisions to improve clarity and simplify implementation. Third draft Remove changes to existing initialization rules. Add @default attribute enabling let properties to supply a default value for their initialization parameter. Move @nomemberwise to future enhancement. Fix mistakes in examples and other typos. typo fix Refined to focus on core functionality 1. Moved @default to future enhancement. 2. Moved initializer chaining to future enhancement. 3. Clarified impact on existing code and the implicit memberwise initializer. Specify Chris Lattner as review manager Typo fixes, clarifications, and slight redundancy reduction. Fix typos and fill out access control alternatives The primary change is a fleshing out of the rationale for the access control design choice made in this proposal under the alternative "Allow parameters to be synthesized for properties with a lower access level than the initializer". Access control refinements and typo fix 1. Clarify eligibility of properties with distinct setter access control. 2. Refine access control of implicitly generated memberwise initializer. 3. Add future enhancement to allow distinct access control for memberwise initialization eligibility.
800b5b5
to
a26e09b
Compare
Thanks Chris. I believe I have squashed them properly now! I made a few further refinements to the interaction with access control you might want to review:
|
…tion Flexible memberwise initialization
Awesome! We'll open the discussion period early next year, most likely the week of Jan 4th. Thanks! |
No description provided.