(module rc_box_drop
  (data Box
    (doc "Single-cell ADT around an Int. Iter 18c.3 RC fixture: shallow free is sufficient because Box has no boxed children.")
    (ctor MkBox (con Int)))
  (fn main
    (doc "Bind a heap-allocated MkBox to `b`, read its Int via match, print it. Under --alloc=rc, codegen emits `ailang_rc_dec(b)` at the let scope close: `b` is unique, has zero consume uses (only the match scrutinee, a borrow), and the body's tail value is the printed Unit, not `b` itself. The Box has no boxed children so shallow `free()` is correct.")
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body (let b (term-ctor Box MkBox 42) (match b
      (case (pat-ctor MkBox x) (app print x)))))))
