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

lib: Remove Any.hash_code #1999

Merged
merged 1 commit into from
Sep 20, 2023
Merged

lib: Remove Any.hash_code #1999

merged 1 commit into from
Sep 20, 2023

Conversation

fridis
Copy link
Member

@fridis fridis commented Sep 20, 2023

Just like equality, the hash_code function should be a type feature and not be defined for Any and inherited.

For hash_code to be useful, the following invariant should hold:

  (hash_code a != hash_code b) || (a = b)

So the semantics of hash_code depends on type.equality, so hash_code should be a type feature as well.

Just like equality, the hash_code function should be a type feature and not be
defined for Any and inherited.

For hash_code to be useful, the following invariant should hold:

  (hash_code a != hash_code b) || (a = b)

So the semantics of hash_code depends on type.equality, so hash_code should be a
type feature as well.
@michaellilltokiwa michaellilltokiwa merged commit e356626 into main Sep 20, 2023
5 checks passed
@michaellilltokiwa michaellilltokiwa deleted the remove_Any_hash_code branch September 20, 2023 11:39
fridis pushed a commit that referenced this pull request Sep 20, 2023
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

3 participants