@@ -38,22 +38,7 @@ func (check *Checker) declare(scope *Scope, id *ast.Ident, obj Object, pos token
38
38
}
39
39
40
40
// pathString returns a string of the form a->b-> ... ->g for a path [a, b, ... g].
41
- // TODO(gri) remove once we don't need the old cycle detection (explicitly passed
42
- // []*TypeName path) anymore
43
- func pathString (path []* TypeName ) string {
44
- var s string
45
- for i , p := range path {
46
- if i > 0 {
47
- s += "->"
48
- }
49
- s += p .Name ()
50
- }
51
- return s
52
- }
53
-
54
- // objPathString returns a string of the form a->b-> ... ->g for a path [a, b, ... g].
55
- // TODO(gri) s/objPathString/pathString/ once we got rid of pathString above
56
- func objPathString (path []Object ) string {
41
+ func pathString (path []Object ) string {
57
42
var s string
58
43
for i , p := range path {
59
44
if i > 0 {
@@ -68,7 +53,7 @@ func objPathString(path []Object) string {
68
53
// For the meaning of def, see Checker.definedType, in typexpr.go.
69
54
func (check * Checker ) objDecl (obj Object , def * Named ) {
70
55
if trace {
71
- check .trace (obj .Pos (), "-- checking %s %s (objPath = %s)" , obj .color (), obj , objPathString (check .objPath ))
56
+ check .trace (obj .Pos (), "-- checking %s %s (objPath = %s)" , obj .color (), obj , pathString (check .objPath ))
72
57
check .indent ++
73
58
defer func () {
74
59
check .indent --
@@ -291,7 +276,7 @@ func (check *Checker) typeCycle(obj Object) (isCycle bool) {
291
276
}
292
277
293
278
if trace {
294
- check .trace (obj .Pos (), "## cycle detected: objPath = %s->%s (len = %d)" , objPathString (cycle ), obj .Name (), ncycle )
279
+ check .trace (obj .Pos (), "## cycle detected: objPath = %s->%s (len = %d)" , pathString (cycle ), obj .Name (), ncycle )
295
280
check .trace (obj .Pos (), "## cycle contains: %d values, has indirection = %v, has type definition = %v" , nval , hasIndir , hasTDef )
296
281
defer func () {
297
282
if isCycle {
0 commit comments