Module type_check

Expand description

The type_check module defines the main part of the semantic analysis stage, which is type checking. This involves the following tasks:

  • type resolution: Resolve all declared types in the AST to their canonical AstType representations.
  • type annotation: Annotate every expression in the AST with its AstType, and add implicit type casts where necessary.
  • type validation: Emit diagnostics for semantic errors where usage of types are invalid.
  • build symbols: Build a Symbol Table of all symbols in the AST and their types.

Structs§

TypeChecker
The Type Checker holds mutable state necessary for type checking.

Functions§

type_check
Performs type checking on the AST.