Skip to main content

capability_op_sig_from_commons

Function capability_op_sig_from_commons 

Source
pub fn capability_op_sig_from_commons(
    commons: &TypedCommons,
    cap: &str,
    op: &str,
) -> Option<OpSig>
Expand description

P6.29 (design/tracks/the-ir.md §6a): the TypedCommons-only counterpart to lower_capability_item_ir, for call sites (emitter/lower.rs’s cap_op_param_names) that have a TypedCommons in hand but no CheckedProgramLowerCtx/ModuleCtx never carry one (see lower_op_sig_ir_from_commons, this function’s own single-op sibling, for the identical reason it exists as a separate entry point rather than a thin wrapper over the CheckedProgram-driven lower_op_sig_ir).

Resolves one capability operation’s signature by name — “find the op named op on the capability named cap” has no IR-native replacement (nothing indexes capabilities by name once lowered), so this still walks TypedCommons::commons.items the same way the code it replaces did. First match in item order; None on no match, mirroring the caller’s own prior fallthrough-to-empty behaviour exactly.