Skip to content

[5.0][Sema] Emit a deprecation warning if a Hashable type only implements hashValue #21445

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

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Dec 19, 2018

(Cherry-picked from #21057 and #20866)

SE-206 deprecated hashValue as a protocol requirement. We should gently encourage people to migrate to hash(into:), for its more secure, easier and faster hashing.

rdar://problem/39838478, rdar://problem/46344811

lorentey and others added 4 commits December 19, 2018 22:52
…into:) isn’t

SE-206 deprecated hashValue as a protocol requirement. We should gently encourage people to migrate to hash(into:), for its more secure, easier and faster hashing.

Emit a compiler warning whenever hashValue has an explicit implementation, but hash(into:) doesn’t.

(cherry picked from commit e0495a7)
Co-Authored-By: lorentey <klorentey@apple.com>
(cherry picked from commit 646849e)
@lorentey lorentey changed the base branch from master to swift-5.0-branch December 19, 2018 22:54
@lorentey
Copy link
Member Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6b97b91

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6b97b91

@lorentey
Copy link
Member Author

Ah, my bad, this requires (at least some parts of) #20866 for the test suite.

@lorentey lorentey requested a review from a team as a code owner December 20, 2018 17:45
@lorentey lorentey force-pushed the actually-deprecate-hashValue-5.0 branch from fda620d to ade8310 Compare December 20, 2018 17:58
@lorentey
Copy link
Member Author

@swift-ci test

@airspeedswift airspeedswift merged commit c22c0b8 into swiftlang:swift-5.0-branch Jan 2, 2019
@lorentey lorentey deleted the actually-deprecate-hashValue-5.0 branch January 7, 2019 11:37
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.

4 participants