aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/resolver_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-01-07 17:38:12 -0800
committerRobert Griesemer <gri@golang.org>2021-01-08 17:32:20 +0000
commitd017a1b64951d43b009c18454443025cbc9373e1 (patch)
tree8dc8d5f7fad38d6f777c6fdad5d085c608b7b73d /src/cmd/compile/internal/types2/resolver_test.go
parent7903214fcc52a53a7749b4634eb9e940c27ffe75 (diff)
downloadgo-d017a1b64951d43b009c18454443025cbc9373e1.tar.gz
go-d017a1b64951d43b009c18454443025cbc9373e1.zip
[dev.typeparams] cmd/compile/internal/syntax: add Walk node vistor from types2
This moves the Walk visitor from the types2 to the syntax package. There are no changes but for package name adjustments. Preparation for a more full-fledged node visitor. Change-Id: I95217e27ff943ac58a7638fb8d1cd347d0d554b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/282556 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>
Diffstat (limited to 'src/cmd/compile/internal/types2/resolver_test.go')
-rw-r--r--src/cmd/compile/internal/types2/resolver_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/types2/resolver_test.go b/src/cmd/compile/internal/types2/resolver_test.go
index cdfdba6b43..983e8ec4d6 100644
--- a/src/cmd/compile/internal/types2/resolver_test.go
+++ b/src/cmd/compile/internal/types2/resolver_test.go
@@ -144,7 +144,7 @@ func TestResolveIdents(t *testing.T) {
// check that qualified identifiers are resolved
for _, f := range files {
- Walk(f, func(n syntax.Node) bool {
+ syntax.Walk(f, func(n syntax.Node) bool {
if s, ok := n.(*syntax.SelectorExpr); ok {
if x, ok := s.X.(*syntax.Name); ok {
obj := uses[x]
@@ -172,13 +172,13 @@ func TestResolveIdents(t *testing.T) {
// Check that each identifier in the source is found in uses or defs or both.
// We need the foundUses/Defs maps (rather then just deleting the found objects
- // from the uses and defs maps) because Walk traverses shared nodes multiple
+ // from the uses and defs maps) because syntax.Walk traverses shared nodes multiple
// times (e.g. types in field lists such as "a, b, c int").
foundUses := make(map[*syntax.Name]bool)
foundDefs := make(map[*syntax.Name]bool)
var both []string
for _, f := range files {
- Walk(f, func(n syntax.Node) bool {
+ syntax.Walk(f, func(n syntax.Node) bool {
if x, ok := n.(*syntax.Name); ok {
var objects int
if _, found := uses[x]; found {