diff options
| author | Alan Donovan <adonovan@google.com> | 2025-03-12 18:13:04 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-04-07 15:39:48 -0700 |
| commit | a2cc178edf7908a2686089bdc35d1e6d134c7dd1 (patch) | |
| tree | 455444b6a2458c744ce1baea455bb0decd841499 /api | |
| parent | 230d1407b04da5d65505415b1a7b4f6d70c75086 (diff) | |
| download | go-a2cc178edf7908a2686089bdc35d1e6d134c7dd1.tar.xz | |
go/types: Hasher, a hash function for Types
This CL defines a hash function for Types using the
maphash.Hasher API proposed in #70471 (CL 657296)
that is consistent with the equivalence relation
of types.Identical.
It also defines a variant, HasherIgnoreTypes, that is
consistent with types.IdenticalIgnoreTags. (The actual
hash functions are identical: both ignore tags.)
The logic of the hash function was derived from
golang.org/x/tools/go/types/typeutil.Hash.
+ test, doc, relnote
Fixes #69420
Updates #70471
Change-Id: I1947cda6aec229d56eeda13decfb05eb266770f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/657297
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'api')
| -rw-r--r-- | api/next/69420.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/next/69420.txt b/api/next/69420.txt new file mode 100644 index 0000000000..020948aa72 --- /dev/null +++ b/api/next/69420.txt @@ -0,0 +1,6 @@ +pkg go/types, method (Hasher) Equal(Type, Type) bool #69420 +pkg go/types, method (Hasher) Hash(*maphash.Hash, Type) #69420 +pkg go/types, method (HasherIgnoreTags) Equal(Type, Type) bool #69420 +pkg go/types, method (HasherIgnoreTags) Hash(*maphash.Hash, Type) #69420 +pkg go/types, type Hasher struct #69420 +pkg go/types, type HasherIgnoreTags struct #69420 |
