diff --git a/sledge/src/llair/typ.ml b/sledge/src/llair/typ.ml index 615cb94ed..f45d062cb 100644 --- a/sledge/src/llair/typ.ml +++ b/sledge/src/llair/typ.ml @@ -58,10 +58,9 @@ let pp_defn fs = function (** Invariants *) let is_sized = function - | Function _ | Opaque _ -> false + | Function _ -> false | Integer _ | Float _ | Pointer _ | Array _ | Tuple _ | Struct _ -> true - -let is_sized_or_opaque = function Opaque _ -> true | t -> is_sized t + | Opaque _ -> (* optimistically assume linking will make it sized *) true let invariant t = Invariant.invariant [%here] t [%sexp_of: t] @@ -70,9 +69,8 @@ let invariant t = | Function {return; args} -> assert (Option.for_all ~f:is_sized return) ; assert (Vector.for_all ~f:is_sized args) - | Array {elt} -> assert (is_sized_or_opaque elt) - | Tuple {elts} | Struct {elts} -> - assert (Vector.for_all ~f:is_sized_or_opaque elts) + | Array {elt} -> assert (is_sized elt) + | Tuple {elts} | Struct {elts} -> assert (Vector.for_all ~f:is_sized elts) | Integer {bits} | Float {bits} -> assert (bits > 0) | Pointer _ | Opaque _ -> assert true