diff options
author | Robert Griesemer <gri@golang.org> | 2023-01-09 13:54:50 -0800 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-01-17 19:55:37 +0000 |
commit | 97f843b51f69f392bb09b24c077aca505e519551 (patch) | |
tree | 87755edcfe6aa949f8446512f69338f021257e06 /src/go/types/predicates.go | |
parent | f9cba430b228c81e5b5f1ec30e0f6183141f3c0c (diff) | |
download | go-97f843b51f69f392bb09b24c077aca505e519551.tar.gz go-97f843b51f69f392bb09b24c077aca505e519551.zip |
go/types: use nopos instead of token.NoPos to match types2
This will simplify the generation of go/types files from types2 files.
Change-Id: Ie9c8061346cff098cb884908c7eb569267886594
Reviewed-on: https://go-review.googlesource.com/c/go/+/461082
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/go/types/predicates.go')
-rw-r--r-- | src/go/types/predicates.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go index e9a0e438d8..b26b5beb9c 100644 --- a/src/go/types/predicates.go +++ b/src/go/types/predicates.go @@ -6,8 +6,6 @@ package types -import "go/token" - // The isX predicates below report whether t is an X. // If t is a type parameter the result is false; i.e., // these predicates don't look inside a type parameter. @@ -312,14 +310,14 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool { // Constraints must be pair-wise identical, after substitution. for i, xtparam := range xtparams { - ybound := check.subst(token.NoPos, ytparams[i].bound, smap, nil, ctxt) + ybound := check.subst(nopos, ytparams[i].bound, smap, nil, ctxt) if !identical(xtparam.bound, ybound, cmpTags, p) { return false } } - yparams = check.subst(token.NoPos, y.params, smap, nil, ctxt).(*Tuple) - yresults = check.subst(token.NoPos, y.results, smap, nil, ctxt).(*Tuple) + yparams = check.subst(nopos, y.params, smap, nil, ctxt).(*Tuple) + yresults = check.subst(nopos, y.results, smap, nil, ctxt).(*Tuple) } return x.variadic == y.variadic && @@ -331,8 +329,8 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool { // TODO(rfindley): can this be reached during type checking? If so, // consider passing a type set map. unionSets := make(map[*Union]*_TypeSet) - xset := computeUnionTypeSet(nil, unionSets, token.NoPos, x) - yset := computeUnionTypeSet(nil, unionSets, token.NoPos, y) + xset := computeUnionTypeSet(nil, unionSets, nopos, x) + yset := computeUnionTypeSet(nil, unionSets, nopos, y) return xset.terms.equal(yset.terms) } |