summaryrefslogtreecommitdiff
path: root/compiler/InterpreterBorrows.ml
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/InterpreterBorrows.ml')
-rw-r--r--compiler/InterpreterBorrows.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/InterpreterBorrows.ml b/compiler/InterpreterBorrows.ml
index 208918af..0b7b4be5 100644
--- a/compiler/InterpreterBorrows.ml
+++ b/compiler/InterpreterBorrows.ml
@@ -1005,7 +1005,13 @@ and end_abstraction_aux (config : C.config) (chain : borrow_or_abs_ids)
let abs = C.ctx_lookup_abs ctx abs_id in
(* Check that we can end the abstraction *)
- assert abs.can_end;
+ if abs.can_end then ()
+ else
+ raise
+ (Failure
+ ("Can't end abstraction "
+ ^ V.AbstractionId.to_string abs.abs_id
+ ^ " as it is set as non-endable"));
(* End the parent abstractions first *)
let cc = end_abstractions_aux config chain abs.parents in