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

10 lines
477 B
Plaintext

;; ZII fills an omitted field with all-bytes-zero, and a zeroed function value
;; is a null pointer — the one kind of zero that is not a value the type can
;; have. Every other type's zero is one: 0, false, an empty slice, None, a
;; union's first case. So it is refused where the field is written rather than
;; left to crash at the call, and the same rule covers a global, a fixed
;; array's element and (zeroed).
(defstruct Ops [run (Fn [i32] i32)])
(defn main [] i32 0)