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
Attachment: Download
Xcode 10.0 beta 5 (10L221o)
md5: 263f93699fc38d78453e79f78753428c
Issue Description:
Given a objc base class that has a readonly property and also conforms to ProtocolA:
@interface ClassA : NSObject <ProtocolA> @property (readonly, nonatomic, nullable) NSString *aProperty; @end
Where ProtocolA defines a getter for a property:
@protocol ProtocolA - (nullable NSString *)aProperty; @end
A subclass that redefines the property as readwrite:
@interface ClassB : ClassA @property (readwrite, nonatomic, nullable) NSString *aProperty; @end
The property is incorrectly bridged to readonly in Swift:
let classB = ClassB() classB.aProperty = "foo" // Error: Cannot assign to property: 'aProperty' is a get-only property
This is a regression from Swift 4 / Xcode 9.4.1 (9F2000) where the property is bridged as readwrite.
Attached sample project that includes the code above.
The text was updated successfully, but these errors were encountered:
Thanks, Jonas!
@swift-ci create
Sorry, something went wrong.
The protocol is relevant, too. I guess we're refusing to import the "conflicting" property before realizing that there's one in the superclass anyway.
#18749
@belkadan: I still see this issue in Xcode 10 GM - Version 10.0 (10A254a). Perhaps the commit was simply to late to be included in the release branch? But I am not sure which release branch to check.
That's correct, the fix did not make it into the release branch. Sorry for the trouble.
@bobergj, Could you verify if the problem is fixed and if so move the JIRA to "Closed"?
Thanks! Anna
belkadan
No branches or pull requests
Attachment: Download
Environment
Xcode 10.0 beta 5 (10L221o)
Additional Detail from JIRA
md5: 263f93699fc38d78453e79f78753428c
Issue Description:
Given a objc base class that has a readonly property and also conforms to ProtocolA:
Where ProtocolA defines a getter for a property:
A subclass that redefines the property as readwrite:
The property is incorrectly bridged to readonly in Swift:
This is a regression from Swift 4 / Xcode 9.4.1 (9F2000) where the property is bridged as readwrite.
Attached sample project that includes the code above.
The text was updated successfully, but these errors were encountered: