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

a doubt about hashCode of Value #18

Open
hahacyd opened this issue Aug 6, 2023 · 0 comments
Open

a doubt about hashCode of Value #18

hahacyd opened this issue Aug 6, 2023 · 0 comments

Comments

@hahacyd
Copy link

hahacyd commented Aug 6, 2023

current implementation of Value's hashCode is:
public int hashCode() { return value; }
but this will result in
Value.makeConstant(0).hashCode() equals Value.getNAC().hashCode() and Value.getUndef().hashCode()

and thus a hashCode of CPFact's instance may not changed when a Value changed.

an optional implementation
public int hashCode() { return toString().hashCode(); }

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

No branches or pull requests

1 participant