-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Use the accessor names as written in Objective-C. #27557
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
Use the accessor names as written in Objective-C. #27557
Conversation
@swift-ci please test |
Build failed |
We are dropping the getter and setter names we get from Objective-C. This leads to a runtime crash. Oops.
Fixes rdar://problem/55519276.
@swift-ci please test |
Build failed |
Build failed |
IIRC, Slava was aiming to eliminate uses of the raw |
I think the right fix is to not mark imported accessors that correspond to objc methods as implicit. Only bona fide synthesized accessors should be implicit (eg, those for stored properties of structs, or a modify accessor synthesized when a property witnesses a mutable protocol requirement, etc). And John is right, we should not be introducing new usages of |
@swift-ci please test Linux platform |
It is fine if we synthesize the accessors a bit more than usual as PrintAsObjC isn't performance-sensitive and IRGen needs the accessors anyways.
@swift-ci please test |
Note: I've added a new commit as I think @edymtt cherry-picked the first two commits elsewhere, so I didn't want to mess with history by squashing the third commit on top of the second one, just in case it causes issues. |
Build failed |
Build failed |
Note for anyone else reading: the imported accessor is explicit in the existing code. Which is correct behavior. Hence, I didn't make any changes there. |
Not 100% sure if my approach taken here is correct. It is unclear to me what the semantics of
getParsedAccessor
are supposed to be in the presence of user-written accessor names in Objective-C (as opposed to those written in Swift). Should they be passed through? Or not passed through because they are considered implicit? I've assumed that the existing behavior ofgetParsedAccessor
is correct, so we usegetAccessor
instead.Fixes rdar://problem/55519276.
Related: commit 0c5d52d (PR #26461) where
getParsedAccessor
was introduced.