From 161818222000969e42a691d21eb1ec325d335481 Mon Sep 17 00:00:00 2001 From: Brummel Date: Sun, 10 May 2026 22:02:29 +0200 Subject: [PATCH] iter 23.2.2-fixup-doc: tighten try_emit_primitive_instance_body contract doc --- crates/ailang-codegen/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ailang-codegen/src/lib.rs b/crates/ailang-codegen/src/lib.rs index 6431c64..30f5958 100644 --- a/crates/ailang-codegen/src/lib.rs +++ b/crates/ailang-codegen/src/lib.rs @@ -2441,9 +2441,12 @@ impl<'a> Emitter<'a> { /// rather than the `@strcmp + icmp eq i32 0` shape that /// `lower_eq`'s Str arm would emit if we let the lambda body /// `(== x y)` go through the normal path. Returns `Ok(true)` if - /// the body was emitted (caller must return immediately from - /// `emit_fn`); `Ok(false)` lets `emit_fn` continue with the - /// normal body lowering. + /// the body was emitted (including the closing `}` and a final + /// `\n\n`); `emit_fn` skips its normal body-lowering branch but + /// MUST still run its post-body steps (deferred-thunk flush and + /// `emit_adapter_and_static_closure` — the closure-pair every + /// top-level fn gets so it is reachable as a `Term::Var` value). + /// `Ok(false)` lets `emit_fn` continue with normal body lowering. /// /// Future iters add `compare__Str` here (23.3); int/bool primitive /// methods (`eq__Int`, `eq__Bool`, `compare__Int`, `compare__Bool`)