Namespace: go.std.go.types

v1.0

Contents

Summary

Provides a low-level interface to the go/types package.

Package types declares the data types and implements
the algorithms for type-checking of Go packages. Use
Config.Check to invoke the type checker for a package.
Alternatively, create a new type checker with NewChecker
and invoke it incrementally by calling Checker.Files.

Type-checking consists of several interdependent phases:

Name resolution maps each identifier (ast.Ident) in the program to the
language object (Object) it denotes.
Use Info.{Defs,Uses,Implicits} for the results of name resolution.

Constant folding computes the exact constant value (constant.Value)
for every expression (ast.Expr) that is a compile-time constant.
Use Info.Types[expr].Value for the results of constant folding.

Type inference computes the type (Type) of every expression (ast.Expr)
and checks for compliance with the language specification.
Use Info.Types[expr].Type for the results of type inference.

For a tutorial, see https://golang.org/s/types-tutorial.

Index

Legend

Constants

Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.

Variables

Functions, Macros, and Special Forms

Types