Skip to content

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

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Feb 14, 2024

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

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).
@tbkka tbkka marked this pull request as ready for review February 14, 2024 20:19
@tbkka
Copy link
Contributor Author

tbkka commented Feb 14, 2024

@swift-ci Please test

@tbkka tbkka requested a review from a team as a code owner February 14, 2024 20:51
@tbkka
Copy link
Contributor Author

tbkka commented Feb 14, 2024

@swift-ci Please test

@tbkka tbkka merged commit 0308b16 into swiftlang:main Feb 15, 2024
@@ -458,6 +464,11 @@ - (NSUInteger)hash {
selfHeader->type, hashableConformance);
}

if (!runtime::bincompat::useLegacySwiftObjCHashing()) {
Copy link
Contributor Author

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.

Copy link
Contributor

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.

tbkka added a commit to tbkka/swift that referenced this pull request Feb 23, 2024
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.
tbkka added a commit to tbkka/swift that referenced this pull request Feb 28, 2024
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.
tbkka added a commit to tbkka/swift that referenced this pull request May 9, 2024
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
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.

3 participants