go/types could use some high-level documentation of the basic concepts (the Type
hierarchy, the Object hierarchy), and how to accomplish various kinds of mappings from
syntax to types and vice versa. I think tool builders would also appreciate a
discussion of the commonly misunderstood things, with explained examples, such as:
- a list of invariants related to each Type/Object. The docstrings cover some of them
but it doesn't help a new user become oriented.
- the fact the Objects are canonical.
- what's the deal with Tuple.
- what situations Info.Implicits are for
- that fields (Vars) of structs don't know their owning struct and are in fact may be
equally "owned" by several.
- the analogous situation for interface methods.
- why some Idents/FuncTypes/etc appear in Info.Types but not others
- how PkgName objects work, and the possibility that two distinct PkgName objects can
represent the same package.
- that a struct may contain two fields (or an interface two methods) both named
- that a struct field identifier may be simultaneously use a type and define a field
- how to determine whether an object is universal, file-scope, package scope or local,
and which object kinds can inhabit which scopes.
The text was updated successfully, but these errors were encountered: