Skip to main content

check_context_declarations

Function check_context_declarations 

Source
pub fn check_context_declarations(
    typed: &mut TypedCommons,
    table: &UnitTable,
    cross_context: &CrossContextInfo,
    is_context: bool,
    uses_commons_type_names: &HashSet<String>,
    subscriber_visible_types: &HashMap<String, Arc<TypeDecl>>,
    refs: &mut RefSink,
    hints: &mut HintSink,
    locals: &mut LocalsSink,
    requirements: &mut RequirementSink,
    tys: &Arc<Types>,
) -> Vec<CompileError>
Expand description

Check capability/provider/service/agent declaration bodies for a context (or adapter) unit. Mutates typed to extend the expr_types map with bindings observed in the new bodies.

The parent builds the shared state read by every per-kind validator — a resolved commons snapshot and the capability_info_map (local capability signatures, extended with the cross-context flattened caps) — then runs the per-declaration-kind validators in a fixed order. The order is load-bearing: multi-error fixtures assert the diagnostic sequence (capabilities → providers → services → agents).