Skip to main content

check_program

Function check_program 

Source
pub fn check_program(
    ast: &Ast,
    src: &str,
) -> (TypedAst, Vec<QalaError>, Vec<QalaWarning>)
Expand description

check a parsed program against the type and effect rules, producing a fully-typed AST plus accumulated errors and warnings.

the typechecker does NOT fail-fast: it recovers locally via QalaType::Unknown poison-propagation and keeps going so a typo at the top of a function does not cascade to a wall of follow-on errors. errors and warnings are sorted by (span.start, span.len) before returning so downstream renderers can rely on byte-deterministic order.