From 1bf53c2184c8fdfa3c409632fce9a6bb859014d3 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sat, 16 May 2026 08:47:46 +0900 Subject: [PATCH] lib/log: document `format` param as permanent (post-#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit c9bbfcb's commit message floated a follow-up — "lib/log can revert format→fmt now that the silent crash is impossible." That note was wrong. #19's rule is decl-site and body-blind by design (single rule, no non-local reasoning), so any `fn x(fmt: str)` under `use fmt;` is refused regardless of whether the body calls fmt.X. Rename infeasible. Rewrite the header bullet to drop the wishlist sentence and state the constraint directly: ww's `.` overload for both module-access and field-access makes `use fmt; fn x(fmt: T)` structurally ambiguous, and #19 refuses it at decl. The `format` parameter name stays. Comment-only; no test surface. --- lib/log/log.ww | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/log/log.ww b/lib/log/log.ww index 8c1f6e01..000526bc 100644 --- a/lib/log/log.ww +++ b/lib/log/log.ww @@ -37,10 +37,11 @@ // some lib/log fn first so init runs. // // • Param name divergence from Hare: the format-string parameter is -// `format` (not Hare's `fmt`) because ww's resolver shadows the -// `fmt` module reference inside a body when a same-name param is -// in scope (silent miscompile — CALL through str.ptr). Tracked as -// task #19; rename to `fmt` when fixed. +// `format` (Hare's is `fmt`). Permanent — #19 refuses any +// let/param that shadows an imported module name, regardless of +// body usage. ww chose `.` for both module-access and field- +// access, so `use fmt; fn x(fmt: T)` is structurally ambiguous; +// the resolver refuses it at decl. // // Sink today is [[io.stream]] only — lib/io has no fd-backed stream // yet (Hare's `io::handle = file | int` collapses to one variant).