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
precondition_lazy.w: require/check messages are evaluated eagerly; the test claims lazy and the substring runner hid it #1864
precondition_lazy.w claims require/check evaluate their message lazily; they do not, and the substring runner never noticed
Found by #1855's exact expect-stdout rule. test/behavior/precondition_lazy.w:
//! expect-stdout: ok
// Test: lazy message evaluation.
// The message expression must NOT be evaluated when the condition is true.
fn side_effect() -> str:
print("SHOULD NOT PRINT")
"message"
fn main:
require(true, side_effect())
check(true, side_effect())
print("ok")
Actual stdout:
SHOULD NOT PRINT
SHOULD NOT PRINT
ok
The old runner passed it because ok is a substring of the output. lib/std/builtins.w declares require(cond: bool, msg: &str, loc: &str = src()) and check the same, so the message is an ordinary argument, evaluated before the call. The spec (§10, §9) says nothing about lazy messages for require/check (?? and unwrap_or_else are the documented lazy forms).
Maintainer's call: either the message becomes lazy (a fn() -> str / closure form, or a language rule) and the spec says so, or the fixture's claim goes. Until then the fixture carries //! known-issue: for this issue and stays red under the exact rule.
Decision brief (coordinator, 2026-10-03; from the wave-build agent, verified against the spec).
1. Others. Swift precondition(_:_:) takes the message as @autoclosure — evaluated only on failure, no caller ceremony. Rust assert!/debug_assert! evaluate the format arguments only when the assertion fails. Zig's assert takes no message. 2. Spec. No chapter says require/check messages are lazy; the only lazy forms the spec names are ?? and with_context. test/behavior/precondition_lazy.w claims laziness that the implementation doesn't have (the substring runner hid it; #1855 fixed the runner half). 3. Mission fit. Lazy: an expensive message (formatting, a lookup) never runs on a passing check, and the user writes nothing extra — a message is obviously only needed on failure. Eager would make users hoist checks into an if to avoid the cost: ceremony. 4. Prediction. Eric rules lazy, Swift-style, ~80%. Draft words (preconditions chapter): "The message operand of require and check is evaluated only when the condition is false."
Eric's direction (2026-10-03): lazy, with the mechanism stated. Revised draft words for the preconditions chapter (need Eric's blessing of the words):
assert, require, check and their std.testing forms are compiler-known forms, not functions. Each evaluates its message operand only when its condition is false. The message operand follows the rules of the right operand of ??: its effects do not run when the condition holds, and a move inside it is a conditional move.
No general lazy-parameter feature is introduced. The silent tool half (the substring runner) was #1855, fixed 2026-09-29; this issue is the false claim it hid.
Activity
Test runner: expect-stdout lines are the whole stdout, in order, once…
ehartford commentedon Oct 3, 2026
Decision brief (coordinator, 2026-10-03; from the wave-build agent, verified against the spec).
1. Others. Swift
precondition(_:_:)takes the message as@autoclosure— evaluated only on failure, no caller ceremony. Rustassert!/debug_assert!evaluate the format arguments only when the assertion fails. Zig'sasserttakes no message.2. Spec. No chapter says
require/checkmessages are lazy; the only lazy forms the spec names are??andwith_context. test/behavior/precondition_lazy.w claims laziness that the implementation doesn't have (the substring runner hid it; #1855 fixed the runner half).3. Mission fit. Lazy: an expensive message (formatting, a lookup) never runs on a passing check, and the user writes nothing extra — a message is obviously only needed on failure. Eager would make users hoist checks into an
ifto avoid the cost: ceremony.4. Prediction. Eric rules lazy, Swift-style, ~80%.
Draft words (preconditions chapter): "The message operand of
requireandcheckis evaluated only when the condition is false."ehartford commentedon Oct 3, 2026
Eric's direction (2026-10-03): lazy, with the mechanism stated. Revised draft words for the preconditions chapter (need Eric's blessing of the words):
No general lazy-parameter feature is introduced. The silent tool half (the substring runner) was #1855, fixed 2026-09-29; this issue is the false claim it hid.
Spec v7.17: four rulings of 2026-10-03 (#1930 #1903 #2003 #1864) (#2021)
D86 (#1864): assert/require/check are compiler-known forms; the messa…
#2024: pipeline stage calls get the callee's default arguments; #2026:…
ehartford commentedon Oct 3, 2026
Fixed on main in 74e3001 (stack #2032; seed-driven battery GREEN on 2b9ad28, tree identical to main).
Spec changelog: the NON-COMPLIANT sentences of fourteen entries whose…