Documentation
¶
Overview ¶
This package implements typechecking of a Go AST. The result of the typecheck is an augmented AST with object and type information for each identifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Universe *ast.Scope
The Universe scope contains all predeclared identifiers.
Functions ¶
func CheckFile ¶
CheckFile typechecks a single file, but otherwise behaves like CheckPackage. If the complete package consists of more than just one file, the file may not typecheck without errors.
func CheckPackage ¶
CheckPackage typechecks a package and augments the AST by setting *ast.Object, *ast.Type, and *ast.Scope fields accordingly. If an importer is provided, it is used to handle imports, otherwise they are ignored (likely leading to typechecking errors).
If errors are reported, the AST may be incompletely augmented (fields may be nil) or contain incomplete object, type, or scope information.