Skip to content

[SE-0258] Improve backward compatibility of the newer property wrappers implementation #25393

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 4 commits into from
Jun 12, 2019

Conversation

DougGregor
Copy link
Member

Improve compatibility of the newer property wrappers implementation with the first property-delegate-based implementation. Specifically:

  • Switch over to @propertyWrapper as the primary attribute name; add deprecated aliases for @_propertyWrapper and @propertyDelegate
  • Add support for using delegateValue when wrapperValue is not present

…teraction

When the backing storage of a wrapped property is default-initialized via the
property wrapper type's init(), don't count that as a direct initialization
of the backing storage for the purposes of constructing the memberwise
initializer. Instead, treat this case the same as if there were no initializer,
keying the form of the memberwise initializer off the presence of
init(initialValue:).
…perValue'.

Provide some backward compatibilty for property delegates written before
they became property wrapper, picking up 'delegateValue' (if present)
but warning about it.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit d878aed into swiftlang:master Jun 12, 2019
@DougGregor DougGregor deleted the property-wrapper-attr-rename branch June 12, 2019 23:22
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.

2 participants