summaryrefslogtreecommitdiff
path: root/compiler/ValuesUtils.ml
diff options
context:
space:
mode:
authorSon Ho2022-11-06 13:17:09 +0100
committerSon HO2022-11-07 10:36:13 +0100
commit55a4a7c8ef7bf9b393b593c8d4591aad7895cf06 (patch)
treec2737530e63a80632dacb18bc59de42b3232b738 /compiler/ValuesUtils.ml
parentef4ac7cb389e2b135b1a81f448aa90ee7d7d8430 (diff)
Replace all the occurrences of `failwith ...` with `raise (Failure ...)`
Diffstat (limited to '')
-rw-r--r--compiler/ValuesUtils.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ValuesUtils.ml b/compiler/ValuesUtils.ml
index 72d7abe0..0e1714a8 100644
--- a/compiler/ValuesUtils.ml
+++ b/compiler/ValuesUtils.ml
@@ -25,12 +25,12 @@ let is_symbolic (v : value) : bool =
match v with Symbolic _ -> true | _ -> false
let as_symbolic (v : value) : symbolic_value =
- match v with Symbolic s -> s | _ -> failwith "Unexpected"
+ match v with Symbolic s -> s | _ -> raise (Failure "Unexpected")
let as_mut_borrow (v : typed_value) : BorrowId.id * typed_value =
match v.value with
| Borrow (MutBorrow (bid, bv)) -> (bid, bv)
- | _ -> failwith "Unexpected"
+ | _ -> raise (Failure "Unexpected")
(** Check if a value contains a borrow *)
let borrows_in_value (v : typed_value) : bool =