; NEGATIVE FIXTURE. The LLM-natural mistake: the author intends to
; recur with the updated Int accumulator but accidentally passes a
; Bool (the comparison result) into the first binder position.
; Expected: `ail check` exits 1 with code recur-type-mismatch.
(module loop_recur_3c_recur_type
  (fn count_down
    (type (fn-type (params (own (con Int))) (ret (own (con Int)))))
    (params start)
    (body
      (loop (i (con Int) start)
        (if (app eq i 0)
            i
            (recur (app gt i 0))))))
  (fn main
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body (app print (app count_down 5)))))
