The truthiness retry is to reuse the first pass and stay linear

This commit is contained in:
Joseph Ferano 2026-09-25 10:16:45 +07:00
parent c1dcdeb5af
commit 49a7860cc4

View File

@ -827,7 +827,8 @@ the losing side meets the strict =bool= boundary and traps —
=(or false (box "s"))= is the case. Whether a =bool= arm and a =dyn= arm should
join as =dyn= is the author's call and is not settled.
** TODO A truthiness failure re-runs the whole failing subtree
** NEXT A truthiness failure re-runs the whole failing subtree
Decided 2026-09-25: fix it without changing any message — the retry reuses what the first pass settled for each subtree (memoised by node), so nested =not= is linear. Test with a deep nest that must fail fast and with the existing message tests unchanged.
The retry exists to keep a refused literal's message unchanged and re-runs the
subtree rather than the leaf, which is exponential in nested =not= depth on a
program that does not type-check. Moot for anything that compiles; only the