Skip to main content

lower_fn_item_ir

Function lower_fn_item_ir 

Source
pub fn lower_fn_item_ir(f: &Arc<FnDecl>, program: &CheckedProgram) -> IrItem
Expand description

P6.6 (#1161): lower a fn declaration into a real IrItem::Fn — wraps lower_fn_body_ir (#1141, unchanged) rather than re-deriving its own rigid-variable seeding or body lowering; adds only def/receiver/ params/ret/effectful around its existing return value. Covers both free functions and methods alike (FnName::Free/FnName::Method) — which IrItem::Fns a future printer re-attaches under which IrItem::Type’s own namespace (R8.1) is phase 7’s own concern, not decided here.

Takes f: &Arc<FnDecl> for a cheap clone into lower_fn_body_ir/fn_receiver_ty/fn_rigid_type_vars’s own calls below, not because this constructor itself keeps a copy any more — P6.39 dropped IrItem::Fn::def (no production reader ever read it back; this constructor has no production call site at all today either).