pub fn check_module(
module: &ModulePath,
modules: &ModuleSet,
types: &TypeRegistry,
lookup: &OpLookup,
) -> Vec<ModuleDiagnostic>Expand description
Checks every registered definition using its declaring module and real source owner.
module must identify a registered module; checking includes unused definitions in
other registered modules, so the same collection has the same semantic validity for
every valid selection. Checks all authored directions before source specialization,
including inactive branches. No initializer, default, method, filter, requirement,
or match expression executes. Whole-graph planning and guard independence remain
construction-time checks; this operation does not require isolated solvability.
Checks default availability for every output’s backing cell, even with a writer;
initialized ordinary cells and sources do not require a default.
Returns diagnostics for unknown selection, names, complete types, bodies, bindings,
branch eligibility and source-specialized empty relationships. Labels own genuine
sources independently of modules.
- Complexity: O(n² + s) bookkeeping plus CEL compilation, registry resolution and native preflight, where n is authored syntax and s is body edges in distinct (definition, source-parameter-mask) specializations.
§Examples
use adam_lang::{ModulePath, ModuleSet, TypeRegistry, check_module};
let path: ModulePath = "example".parse()?;
let mut modules = ModuleSet::new();
modules.insert_source(path.clone(), "example.adm2",
"sheet copy(a: i32, b: i32) { relationship { a := b; b := a; } }")?;
assert!(check_module(&path, &modules, &TypeRegistry::new(),
&cel_parser::OpLookup::new()).is_empty());