diff options
author | Robert Griesemer <gri@golang.org> | 2021-08-23 18:29:38 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-08-24 16:36:48 +0000 |
commit | 1ff0554b5318d5a39e2b26a9c84330e6aa47b1c6 (patch) | |
tree | 14a98ed5b571cdf8bcdf847077e7ee04b9869de2 /src/cmd/compile/internal/types2/predicates.go | |
parent | bd9776357732eb3a3c635427bb3591e4cbc79cc5 (diff) | |
download | go-1ff0554b5318d5a39e2b26a9c84330e6aa47b1c6.tar.gz go-1ff0554b5318d5a39e2b26a9c84330e6aa47b1c6.zip |
cmd/compile/internal/types2: use []*TypeParam rather than []*TypeName for type param lists
This is a port of CL 343932 from go/types, with the necessary adjustments
to the compiler.
This change improves type safety slightly, avoids many internal type
assertions, and simplifies some code paths.
Change-Id: Ie9c4734814f49cd248927152d7b3264d3578428c
Reviewed-on: https://go-review.googlesource.com/c/go/+/344614
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/predicates.go')
-rw-r--r-- | src/cmd/compile/internal/types2/predicates.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go index 3c883e1ab5..ed62743f6d 100644 --- a/src/cmd/compile/internal/types2/predicates.go +++ b/src/cmd/compile/internal/types2/predicates.go @@ -349,13 +349,13 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool { return false } -func identicalTParams(x, y []*TypeName, cmpTags bool, p *ifacePair) bool { +func identicalTParams(x, y []*TypeParam, cmpTags bool, p *ifacePair) bool { if len(x) != len(y) { return false } for i, x := range x { y := y[i] - if !identical(x.typ.(*TypeParam).bound, y.typ.(*TypeParam).bound, cmpTags, p) { + if !identical(x.bound, y.bound, cmpTags, p) { return false } } |