2.9 KiB
iter 23.4-prep — checker prerequisites for prelude free fns
Date: 2026-05-11 Branch: iter/23.4-prep Status: DONE Tasks completed: 2 of 2
Summary
Closes two localised checker gaps that BLOCKED iter 23.4 mid-flight:
-
Gap 2 (Task 1):
linearity::check_module's globals-construction loop now iteratesDef::Classmethods and registers each method type in the globals map. Previously, a borrow-mode fn that forwarded its borrow-mode params into a class-method call firedconsume-while-borrowedfalse positives, becausecallee_arg_modesdefaulted toConsumewhen it could not find the method'sparam_modes.Def::Instancestays a no-op: instance method bodies are walked separately viaDef::Fnafter monomorphisation, per the comment in the new arm. -
Gap 1 (Task 2): the
Term::Var { name }lookup ladder insynthgrows one new branch between the class-method arm and the dot-qualified arm. It iteratesenv.imports.values()to find a free-fn match in any implicitly-imported module's flat-globals table; on hit, it qualifies any owner-module-local Type::Cons via the existingqualify_local_typeshelper (mirror of the dot-qualified arm). Today the prelude is the only implicit import, so single-match-wins is unambiguous; the code comment names the future revisit point for multi-implicit-import ambiguity.
Both fixes are intra-crate and additive — no schema change, no new
diagnostic, no new workspace plumbing. iter 23.4's five prelude
free fns (ne/lt/le/gt/ge) can now ship against the
existing plan unchanged.
Per-task subjects
- iter 23.4-prep.1: linearity — register Def::Class method types in globals
- iter 23.4-prep.2: check — bare-name fall-through to implicit-imported free fns
Concerns
- No E2E fixture added under
examples/. The plan's own "Plan self-review" identifies the two RED-first tests (one inlinearity.rs, one inlib.rs'scheck_workspace-level test module) as the iter-23.4-prep-shaped coverage. The natural E2E surface (a fixture calling barene 1 2against the prelude) cannot land until iter 23.4 ships the prelude free fns themselves — bothexamples/prelude.ail.jsonand the consumer fixture are out of scope for this iter. iter 23.4's E2E coverage is the right place; flagging here so the next iter does not inherit "no E2E for the prep iter" as unrecorded debt.
Known debt
- The Task 2 branch's
mod_namefirst-match-wins rule remains ambiguous-by-design as long aspreludeis the singleton implicit import. If a second implicit import lands in a future milestone, this branch needs a duplicate-detection diagnostic ("nameXresolves through implicit importsAandB, qualify the call"). The code comment names the revisit point.
Blocked detail
N/A — DONE.
Commits
c10acf0a..aef4ab84
Stats
bench/orchestrator-stats/2026-05-11-iter-23.4-prep.json