-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Bincompat hooks for revised hash/isEqual interop #71620
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
Bincompat hooks for revised hash/isEqual interop #71620
Conversation
This adds in hooks so that the new hash/isEqual interop (which bridges Obj-C hash/isEqual: calls to the corresponding Swift Hashable/Equatable conformances) can be selectively disabled based on the OS and/or client. For now, enable the new semantics everywhere except Apple platforms (which have legacy apps that may be relying on the old semantics).
@swift-ci Please test |
@swift-ci Please test |
@@ -458,6 +464,11 @@ - (NSUInteger)hash { | |||
selfHeader->type, hashableConformance); | |||
} | |||
|
|||
if (!runtime::bincompat::useLegacySwiftObjCHashing()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn. That !
should not have been there... Follow-up PR will fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. Lots of trouble from a line and a dot.
Github PR swiftlang#71620 mixed up one of the bincompat conditionals. It also had some errors in the tests for ObjC interop. For now, this leaves the legacy behavior in place for all Apple platforms.
Github PR swiftlang#71620 mixed up one of the bincompat conditionals. It also had some errors in the tests for ObjC interop. For now, this leaves the legacy behavior in place for all Apple platforms.
PR swiftlang#71620 made this behavior conditional as a way to help provide binary compatibility for legacy software that might be relying on the old behavior. So far, it appears the only such problems arose from the SwiftObject behavior changes, not from SwiftValue behavior. So let's optimistically back this out and make the new behavior unconditional. Resolves rdar://127839540
This adds in hooks so that the new hash/isEqual interop (which bridges Obj-C hash/isEqual: calls to the corresponding Swift Hashable/Equatable conformances) can be selectively disabled based on the OS and/or client.
For now, enable the new semantics everywhere except Apple platforms (which have legacy apps that may be relying on the old semantics).
Resolves: rdar://121399248