-
Notifications
You must be signed in to change notification settings - Fork 12
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
Include type parameters in hash? #13
Comments
For an example see: invenia/Intervals.jl#47 |
(That "close and comment" button is too close to "comment") |
type parameters should be a part of the hash
hash the whole type, including type parameters. All tests pass now.
I think that there is a problem with including type parameters into the hash: It violates the requirement that elements with different hashes must not be considered equal. For example, if you define
then |
A very good point. I cases where additional information is encoded within the type parameters and those types should not hash to be the same (like in the linked example) declaring a Probably the only thing to be done as part of this issue is to document that |
This package was completely overhauled in #32. The caller can now decide if type arguments should be considered or not. I made "not" the default for compatibility with existing clients. Please submit a new issue or PR if you think there is more work to do. |
For some types the parametric types (or values) should be included in the hash. Probably
@auto_hash_equals
should use thetypeof
a type when producing a hash?The text was updated successfully, but these errors were encountered: