diff options
| author | Robert Griesemer <gri@golang.org> | 2019-09-16 16:43:51 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2019-09-17 03:03:59 +0000 |
| commit | 606fa2db7a7cd80292fca7aab6c1787fa274e52b (patch) | |
| tree | a2304a5640d096d15284943af235db18d1656be6 /src | |
| parent | 8f3d9855a10a7a77bffe635bb37f4cfe1090ea0e (diff) | |
| download | go-606fa2db7a7cd80292fca7aab6c1787fa274e52b.tar.xz | |
go/types: remove unused pathString and rename objPathString to pathString (cleanup)
This eliminates an old TODO.
Change-Id: I36d666905f43252f5d338b11ef9c1ed8b5f22b1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/195817
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/go/types/decl.go | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/go/types/decl.go b/src/go/types/decl.go index a13442c951..11d2ee4596 100644 --- a/src/go/types/decl.go +++ b/src/go/types/decl.go @@ -38,22 +38,7 @@ func (check *Checker) declare(scope *Scope, id *ast.Ident, obj Object, pos token } // pathString returns a string of the form a->b-> ... ->g for a path [a, b, ... g]. -// TODO(gri) remove once we don't need the old cycle detection (explicitly passed -// []*TypeName path) anymore -func pathString(path []*TypeName) string { - var s string - for i, p := range path { - if i > 0 { - s += "->" - } - s += p.Name() - } - return s -} - -// objPathString returns a string of the form a->b-> ... ->g for a path [a, b, ... g]. -// TODO(gri) s/objPathString/pathString/ once we got rid of pathString above -func objPathString(path []Object) string { +func pathString(path []Object) string { var s string for i, p := range path { if i > 0 { @@ -68,7 +53,7 @@ func objPathString(path []Object) string { // For the meaning of def, see Checker.definedType, in typexpr.go. func (check *Checker) objDecl(obj Object, def *Named) { if trace { - check.trace(obj.Pos(), "-- checking %s %s (objPath = %s)", obj.color(), obj, objPathString(check.objPath)) + check.trace(obj.Pos(), "-- checking %s %s (objPath = %s)", obj.color(), obj, pathString(check.objPath)) check.indent++ defer func() { check.indent-- @@ -291,7 +276,7 @@ func (check *Checker) typeCycle(obj Object) (isCycle bool) { } if trace { - check.trace(obj.Pos(), "## cycle detected: objPath = %s->%s (len = %d)", objPathString(cycle), obj.Name(), ncycle) + check.trace(obj.Pos(), "## cycle detected: objPath = %s->%s (len = %d)", pathString(cycle), obj.Name(), ncycle) check.trace(obj.Pos(), "## cycle contains: %d values, has indirection = %v, has type definition = %v", nval, hasIndir, hasTDef) defer func() { if isCycle { |
