flan/test/programs/vec-in-struct.flan

8 lines
346 B
Plaintext

;;;; A struct may own a Vec since the second repeal: the field is header
;;;; bytes, assignment copies them, and the two copies alias one buffer.
;;;; Which copy's free runs is the program's business — Odin's contract.
;;;; This used to be a negative fixture; now it pins the admission.
(defstruct Builder [buf (Vec u8)])
(defn main [] i32 0)