pub fn lower_type_item_ir(
decl: &Arc<TypeDecl>,
program: &CheckedProgram,
) -> IrItemExpand description
P6.6 (#1161): lower a type declaration into a real IrItem::Type —
IrItem’s own doc comment names which of its seven design-sketch
variants are real as of this slice (Type/Fn only, Decision D). Takes
a certified &CheckedProgram, matching this module’s own categorical
discipline (this file’s own header doc: “every entry point here takes a
&CheckedProgram”), even though only TypedCommons::types/ty_intern
are read — no per-expression expr_types lookup is involved (Q2,
design/tracks/the-ir.md §3.2), but which fields are read isn’t the
discipline; which failures are allowed to panic! is. Every panic
below asserts “the checker already accepted this declaration” — true
only once certify has run: a bare TypedCommons is not certified by
construction (checker.rs’s own CheckedProgram doc notes the
project/batch path holds per-unit TypedCommons values before that
unit’s build-wide gate is decided), so accepting one here would make
resolve_type_ref_in returning None a reachable, not just a buggy,
outcome.