-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Sema] Emit a deprecation warning if a Hashable type only implements hashValue #21057
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
[Sema] Emit a deprecation warning if a Hashable type only implements hashValue #21057
Conversation
…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.
Build failed |
@swift-ci test |
1 similar comment
@swift-ci test |
You can't test two PRs from the same repo at the same time. (@millenomi just filed a request Radar to be able to do this, though.) |
cc @natecook1000 for the documentation changes. (We don't have a good way to deprecate protocol requirements, so we have to point out the deprecation in the docs instead.) |
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.
Tiny change, otherwise LGTM. Thanks!
@swift-ci test |
SE-206 deprecated
hashValue
as a protocol requirement. We should gently encourage people to migrate tohash(into:)
, for its more secure, easier and faster hashing.Emit a compiler warning whenever
hashValue
has an explicit implementation, buthash(into:)
doesn’t.rdar://problem/39838478
(This was originally part of #20685)