We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 248b94e commit 60643c0Copy full SHA for 60643c0
go/types/typeutil/map.go
@@ -257,10 +257,13 @@ func (h hasher) hash(t types.Type) uint32 {
257
}
258
259
tparams := t.TypeParams()
260
- for i := range tparams.Len() {
261
- h.inGenericSig = true
262
- tparam := tparams.At(i)
263
- hash += 7 * h.hash(tparam.Constraint())
+ if n := tparams.Len(); n > 0 {
+ h.inGenericSig = true // affects constraints, params, and results
+
+ for i := range n {
264
+ tparam := tparams.At(i)
265
+ hash += 7 * h.hash(tparam.Constraint())
266
+ }
267
268
269
return hash + 3*h.hashTuple(t.Params()) + 5*h.hashTuple(t.Results())
0 commit comments