(module embabi1_3_export_list_rejected

  ; An imperative-trained author, asked "export the aggregate so the
  ; host can call it on a whole batch", naturally reaches for a list
  ; parameter — pass the whole chunk in, get the sum out. M1's
  ; embedding ABI is scalar-only, so this MUST fail `ail check`
  ; (export-non-scalar-signature). Kept verbatim: the rejection is
  ; the finding.

  (data IntList
    (ctor Nil)
    (ctor Cons (con Int) (con IntList)))

  (fn sum_chunk
    (export "sum_chunk")
    (type
      (fn-type
        (params (own (con IntList)))
        (ret (own (con Int)))))
    (params xs)
    (body
      (match xs
        (case (pat-ctor Nil) 0)
        (case (pat-ctor Cons h t)
          (app + h (app sum_chunk t)))))))
