Closed
Description
The Type.String method and TypeString function are thin wrappers around a complex set of pretty-printing functions. Object.String and ObjectString are part of the same strongly connected component.
These functions are useful, but some clients need variants that differ in their treatment of named types. For example, when printing results about a particular place in a program, it's best to use the locally appropriate name for each imported package, as determined by the ast.File Scope.
If we changed TypeString and ObjectString so that they accept a func(*Named)string parameter that formats the named types, then all three of these variants could be easily expressed, and any future ones too.