Issue #2494: NK2105 at a caller names the second call in the callee that makes its code parameter run more than once

Open and answer this issue on GitHub.

ready · opened 2026-11-21 · updated 2026-11-21 · 0 comments

Part of #973 After #2493

What it is

ADR-lambdas-1 D4 for user code: when a caller’s lambda moves a captured value and the callee’s parameter is many (D3, inferred by #2493), NK2105 at the caller names the second call or the loop in the callee that makes it so. A ledger diff names the edit (Part I 6.7), so a callee edited to call f twice shows why its callers now fail.

To build

  1. D4 for user code: NK2105 names the second call or loop in the callee. A ledger diff names the edit (Part I 6.7).
  2. Test in tests/compiler/tests/ (Nikaia, with .stderr): a callee that calls f twice gives NK2105 at the caller, naming that call.

Done when

A caller whose lambda moves a captured value into a user function that calls its parameter twice is refused with NK2105 whose text names the callee’s second call, shown by a test in tests/compiler/tests/; the commit that builds item 2 carries the Fixes line for this issue.

Split from #973 by Claude Code

Back to Open Issues