In the comment for the go/types.(*Config).Check method, it says:
Check type-checks a package and returns the resulting package object, the first error if any, and if info != nil, additional type information.
What it does not mention is that the caller must explicitly populate any of the map fields of this type that are to be filled in—it is not sufficient to simply pass a *types.Info. Ideally the documentation would make this explicit, say perhaps:
The type-checker populates each non-nil map field with the corresponding type information. If a given map field is nil, its information will be discarded.
or words to that effect. I'll be happy to send a PR for this (or similar), if we can agree on the wording.
The text was updated successfully, but these errors were encountered: