Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes some violations of the
equals-hashCode
contract in NamedType
.
`NamedType` instances used to only be compared based on their string references. Now, if they have been successfully resolved they will be compared based on their underlying (proxied) type instances, else fall back to comparing strings. This change is not a complete fix because: - `NamedType` equality should also consider scopes - There is some ambiguity between forward declared types and `NoResolvedType` I haven't been able to unravel. Fixing these has been punted in favour of an incremental improvement. As a confirmation that this change is positive and to help prevent the contract from slipping further, `assertTypeEquals` in the "jstype" unit tests is being updated to compare `hashCode()` in addition to `equals()`. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=208553812
- Loading branch information
1 parent
db0da8a
commit d33179d
Showing
7 changed files
with
417 additions
and
99 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
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
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
Oops, something went wrong.