Skip to content

[SE-0258] Revision #3 of the proposal, addressing feedback from review #2 #1054

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

Merged
merged 6 commits into from
Jun 28, 2019

Conversation

DougGregor
Copy link
Member

Changes from the second reviewed version

  • The synthesized storage property is always named with a leading _
    and is always private.
  • The wrapperValue property has been renamed to projectedValue to
    make it sufficiently different from wrappedValue. This also gives
    us the "projection" terminology to talk about the $ property.
  • The projected property (e.g., $foo) always has the same access as
    the original wrapped property, rather than being artificially
    limited to internal. This reflects the idea that, for property
    wrapper types that have a projection, the projection is equal in
    importance to the wrapped value.

…#2

Changes from the second reviewed version

* The synthesized storage property is always named with a leading `_`
  and is always `private`.
* The `wrapperValue` property has been renamed to `projectedValue` to
  make it sufficiently different from `wrappedValue`. This also gives
  us the "projection" terminology to talk about the `$` property.
* The projected property (e.g., `$foo`) always has the same access as
  the original wrapped property, rather than being artificially
  limited to `internal`. This reflects the idea that, for property
  wrapper types that have a projection, the projection is equal in
  importance to the wrapped value.
@benrimmington

This comment has been minimized.

@@ -375,7 +375,7 @@ class Foo {

Many Cocoa classes implement value-like objects that require explicit copying.
Swift currently provides an `@NSCopying` attribute for properties to give
them behavior like Objective-C's `@property(copy)`, invoking the `copy` method
them behave like Objective-C's `@property(copy)`, invoking the `copy` method

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be "make them behave" ?

@rjmccall rjmccall merged commit 8043c9b into swiftlang:master Jun 28, 2019
@DougGregor DougGregor deleted the property-wrappers-revision-3 branch June 30, 2019 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants