You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@[no_alloc] misses an allocating callee declared after the caller (Sema reads fn_may_alloc before the callee's body is checked) #1941
test/compile_errors/err_no_alloc_allocating_callee.w passes only because the callee is declared first.
Cause:fn_may_alloc is written at the end of each body check (SemaCheck.w ~3910) and read by note_allocating_callee (~5800) while later bodies are checked. A caller checked before its callee reads "does not allocate". The callee-first scheduling in prepare_body_order covers only unannotated / view-returning callees.
Evidence of the wider class: with a debug switch that checks top-level bodies in reverse order (WITH_SEMA_BODY_ORDER=reverse, branch parallel-sema), 122 of 1560 test/compile_errors fixtures change their diagnostics. Most are one spurious std error, but 16 differ in substance: this missed no_alloc error; an inferred type that changes (fn(i32) -> i32 vs fn(i32) -> Unit, err_1564_debug_no_form_rc); may-suspend/generator-pull results; and spans attributed to the wrong file.
Fix direction: consume the summary after all bodies are checked (a post-body pass over recorded calls, like untyped_callee_calls), not during the caller's body.
Fixed on main by 45cc685 (#1945): @[no_alloc] judges calls to allocating functions after every body is checked (a fixpoint over recorded calls), so a callee declared after the caller is no longer missed; two fixtures that compiled ok before the fix now fail as they should. Battery green.
Activity
WITH_SEMA_BODY_ORDER=reverse: check top-level bodies last to first, t…
@[no_alloc] judges calls to allocating functions after every body is …
Make semantic verdicts independent of body-check order (#1945)
ehartford commentedon Oct 2, 2026
Fixed on main by 45cc685 (#1945):
@[no_alloc]judges calls to allocating functions after every body is checked (a fixpoint over recorded calls), so a callee declared after the caller is no longer missed; two fixtures that compiledokbefore the fix now fail as they should. Battery green.