Skip to content
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

[SR-1494] Protocol's weak property is not forced to be weak in "adapter class" #44103

Closed
swift-ci opened this issue May 12, 2016 · 0 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-1494
Radar None
Original Reporter ogres (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode Version 7.3.1 (7D1014)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: aa779c6fe53a82efa7c3c912f2207694

duplicates:

  • SR-479 Weak properties in protocols not checked in concrete classes

Issue Description:

The following code compiles and gives no warning.

protocol TestProtocol: class {
    weak var weakView: UIView? {get set}
}

class TestSwiftClass: TestProtocol {
    var weakView: UIView?
}

But I believe that you should be forced to have weak property in TestSwiftClass.
For example in ObjC following code gives a warning: " retain (or strong)' attribute on property 'view' does not match the property inherited from 'TestObjcProtocol' "

@protocol TestObjcProtocol <NSObject>

@property (weak,nonatomic,nullable) UIView *view;

@end

@interface TestObject : NSObject <TestObjcProtocol>

@property (nonatomic,nullable) UIView *view;

@end
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant