Skip to content

[4.1] [SR-7182] Allow ownership keywords on properties in @objc protocols. #15275

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 1 commit into from
Mar 15, 2018

Conversation

DougGregor
Copy link
Member

Explanation: SE-0186 removed support for ownership keywords (weak and unowned) on properties in protocols. However, these keywords do have meaning for @objc protocols, where they affect the @property declaration that is created in the generated header. Allow these keywords (again) on properties of @objc protocols.
Scope: Affects projects that define @objc protocols with weak or unowned properties, which were accepted in Swift < 4.1 and started getting warnings in Swift 4.2.
Risk: Effectively none; we're re-enabling something we've had since Swift 1.0 and that was recently disabled.
Testing: Compiler regression tests, including new tests
Reviewer: @jrose-apple
SR / Radar: SR-7182 / rdar://problem/38418112.

Ownership keywords (weak/unmanaged) in @objc protocols do have an
effect on the generated header, because they get reflected as
weak/assign in the Objective-C `@property`. Therefore, allow these
keywords (again) on properties of @objc protocols.

Fixes SR-7182 / rdar://problem/38418112.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please nominate

@DougGregor DougGregor merged commit 04baf31 into swiftlang:swift-4.1-branch Mar 15, 2018
@DougGregor DougGregor deleted the sr-7182-4.1 branch March 15, 2018 21:24
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.

1 participant