(module loop_forever_build
  (fn main
    (doc "loop-recur iter 3 — an infinite loop (no non-recur exit) must COMPILE (typechecks AND compiles; no termination claim). Build-only; by design never returns, so the binary is never executed.")
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body (app print (app spin 0))))
  (fn spin
    (type (fn-type (params (own (con Int))) (ret (own (con Int)))))
    (params n)
    (body (loop (i (con Int) 0) (recur (app + i 1))))))
