]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: do not format TParams when hashing
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 7 Sep 2021 17:33:32 +0000 (00:33 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 7 Sep 2021 17:50:42 +0000 (17:50 +0000)
This is a port of CL 347534 to go/types.

Change-Id: I2b15a29992c430e34592d110be16d7b2b10521a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/348029
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/go/types/typestring.go

index 3d30ff98f39bd61e0fd00e4ca10fb5eafca4c44e..c5f0354aeac940dfee66a9baae55a5d44512cff4 100644 (file)
@@ -235,7 +235,7 @@ func (w *typeWriter) typ(typ Type) {
                if t.targs != nil {
                        // instantiated type
                        w.typeList(t.targs.list())
-               } else if t.TParams().Len() != 0 {
+               } else if !w.hash && t.TParams().Len() != 0 { // For type hashing, don't need to format the TParams
                        // parameterized type
                        w.tParamList(t.TParams().list())
                }