Tai-e-assignments icon indicating copy to clipboard operation
Tai-e-assignments copied to clipboard

a doubt about hashCode of Value

Open cydonialis opened this issue 2 years ago • 0 comments

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(); }

cydonialis avatar Aug 06 '23 11:08 cydonialis