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

[5.0] Make NSObject.hashValue non-overridable #1869

Merged

Conversation

lorentey
Copy link
Member

This is @ikesyo's change that previously landed on master in #1850.

Original description:

This PR fixes an NSObject API inconsistency between Swift 5's SDK overlays on Darwin and swift-corelibs-foundation. It also fixes several NSObject subclasses to customize hashing through the correct API, NSObject.hash.

NSObject.hashValue is currently declared open, which matches Darwin SDK overlays in Swift 4.2 and below. Unfortunately, hashValue was never supposed to be overridden -- NSObject subclasses are expected to customize hashing by overriding NSObject.hash, which is a distinct property. To help clear up the confusion resulting from this subtle gotcha, last year we decided to change NSObject.hashValue to be non-overridable.

(cherry picked from commit 9ee6b02)
(cherry picked from commit 43d94d7)
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey lorentey requested a review from parkera January 31, 2019 19:36
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.

None yet

4 participants