Skip to content

[5.0][Sema] Add dedicated fix-it for NSObject.hashValue overrides #22173

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

Conversation

lorentey
Copy link
Member

(Cherry-picked from #22081)

Explanation: Adds a fix-it to help migrating NSObject.hashValue overrides to the correct property, NSObject.hash.

Scope: Limited to compiler diagnostics.

Issue: rdar://problem/45674813

Risk: Low.

Testing: Local and CI testing on master, including newly added tests for the fix-it functionality.

Reviewed by: @jrose-apple (#22081)

NSObject.hashValue used to be declared `@objc open` by historical accident. This has been corrected to `@nonobjc public` in Swift 5’s SDK overlays, to catch accidental overrides. (These never did work correctly, and shouldn’t have been allowed.)

Help migration by adding a dedicated error message for NSObject.hashValue overrides, with a nice fix-it.

rdar://problem/45674813
(cherry picked from commit df8eba4)
@lorentey lorentey requested a review from a team as a code owner January 28, 2019 15:51
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci please nominate

@airspeedswift airspeedswift merged commit f86388c into swiftlang:swift-5.0-branch Jan 30, 2019
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.

2 participants