Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve ArrowType.hashCode and FunctionType.hashCode to make hash col…
…lisions less likely. For ArrowType: The previous version simply summed all the parameter hashcodes, but since + is commutative this means that function(a,b){} and function(b,a){} would have the same hashCode. Also it included the 'returnTypeInferred' field in the hashCode though it was not part of equals(). This has been fixed. For FunctionType: All functions with the same ArrowType would get the same hashcode. To resolve this we instead just hash more data. Doing this revealed a bug in the equals() method for FunctionType where it was assymmetric and allowed constructors to be equal to ordinary functions in some circumstances. This has been also been fixed. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=141193824
- Loading branch information
1 parent
24d4f1a
commit 666650c
Showing
2 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters