diff options
author | Escherichia | 2024-03-29 14:07:36 +0100 |
---|---|---|
committer | Escherichia | 2024-03-29 14:07:36 +0100 |
commit | 8f969634f3f192a9282a21a1ca2a1b6a676984ca (patch) | |
tree | e1a3a46d7ccc50b887ad6795c8bb37cf81ed270a /compiler/PureUtils.ml | |
parent | 521c7380de5f11bfb190bdccd933ab6c1d0d6ca5 (diff) |
formatting and changed save_error condition for failing from b to not b
Diffstat (limited to '')
-rw-r--r-- | compiler/PureUtils.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/PureUtils.ml b/compiler/PureUtils.ml index 215bebe3..c3afe1c4 100644 --- a/compiler/PureUtils.ml +++ b/compiler/PureUtils.ml @@ -433,11 +433,14 @@ let mk_switch (meta : Meta.meta) (scrut : texpression) (sb : switch_body) : | If (_, _) -> sanity_check __FILE__ __LINE__ (scrut.ty = TLiteral TBool) meta | Match branches -> List.iter - (fun (b : match_branch) -> sanity_check __FILE__ __LINE__ (b.pat.ty = scrut.ty) meta) + (fun (b : match_branch) -> + sanity_check __FILE__ __LINE__ (b.pat.ty = scrut.ty) meta) branches); (* Sanity check: all the branches have the same type *) let ty = get_switch_body_ty sb in - iter_switch_body_branches (fun e -> sanity_check __FILE__ __LINE__ (e.ty = ty) meta) sb; + iter_switch_body_branches + (fun e -> sanity_check __FILE__ __LINE__ (e.ty = ty) meta) + sb; (* Put together *) let e = Switch (scrut, sb) in { e; ty } @@ -529,7 +532,9 @@ let ty_as_integer (meta : Meta.meta) (t : ty) : T.integer_type = | _ -> craise __FILE__ __LINE__ meta "Unreachable" let ty_as_literal (meta : Meta.meta) (t : ty) : T.literal_type = - match t with TLiteral ty -> ty | _ -> craise __FILE__ __LINE__ meta "Unreachable" + match t with + | TLiteral ty -> ty + | _ -> craise __FILE__ __LINE__ meta "Unreachable" let mk_state_ty : ty = TAdt (TAssumed TState, empty_generic_args) |