Skip to main content

Module check

Module check 

Source
Expand description

Bidirectional type checker for the LOGOS compilation pipeline.

Replaces TypeEnv::infer_program() with a proper constraint-solving pass that eliminates Unknown for field access, empty collections, option literals, pipe receives, inspect arm bindings, and closure call expressions.

§Architecture

AST
 │
 ├── preregister_functions   ← forward-reference pre-pass
 │
 └── infer_stmt / infer_expr ← bidirectional checking
          │
          └── UnificationTable ← Robinson unification (from unify.rs)
                   │
                   └── zonk → TypeEnv (LogosType) → codegen

Structs§

IndexedTypeError
Check a LOGOS program and return a typed TypeEnv for codegen.

Functions§

check_program
genuine type contradictions (e.g., Let x: Int be "hello"). Ambiguous types fall back to LogosType::Unknown silently.
check_program_collect
Collect EVERY failing top-level statement instead of bailing at the first.