Type Checking is a process in the compilation pipeline where the compiler verifies that the operations in the source code respect the type rules of the language.
In the Go compiler, it is performed in several phases over the syntax tree, including:
- Name resolution: Remapping identifiers to objects.
- Constant folding: Computing compile-time constants.
- Type inference: Computing types of expressions and verifying no mismatches.
