(module raw_buf_new_type_arg_unit_reject
  (fn main
    (doc "RED-pin fixture for #51 leg 2 (raw-buf F7). A `(new RawBuf (con Unit) 3)` names Unit as the element type — but Unit is NOT in RawBuf's param-in restricted set {Int, Float, Bool}, so this must be REJECTED at `ail check` with `param-not-in-restricted-set` naming Unit. Today the `(new T <type> <values>)` desugar (crates/ailang-core/src/desugar.rs:1053) drops the `NewArg::Type` BEFORE check, so the `(con Unit)` element annotation never reaches the param-in enforcement in check_type_well_formed (crates/ailang-check/src/lib.rs:2084). `ail check` therefore passes (exit 0) and the program only crashes later at `ail build` with the same unregistered `RawBuf_new__Unit` intercept as leg 1. Expected post-fix: a pre-desugar reject on the Term::New shape (per the CLAUDE.md Term::New/desugar lockstep, crates/ailang-check/src/pre_desugar_validation.rs) fails `ail check` with `param-not-in-restricted-set` naming Unit; codegen is never reached.")
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body
      (let b (new RawBuf (con Unit) 3)
        (app print (app RawBuf.size b))))))
