summaryrefslogtreecommitdiff
path: root/compiler/SymbolicToPure.ml
diff options
context:
space:
mode:
authorEscherichia2024-04-05 10:36:40 +0200
committerEscherichia2024-04-05 10:38:14 +0200
commitfc51bfd88076a66000dbfe76e832d3fdd72aee76 (patch)
treebe46d7584464477712cc88c318c508b49c944f9f /compiler/SymbolicToPure.ml
parent061d7f72bec27de46245afc82149271ca8c75627 (diff)
error catching should now be able to tell when code couldn't be generated
Diffstat (limited to 'compiler/SymbolicToPure.ml')
-rw-r--r--compiler/SymbolicToPure.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/SymbolicToPure.ml b/compiler/SymbolicToPure.ml
index f036cc37..b4c55d80 100644
--- a/compiler/SymbolicToPure.ml
+++ b/compiler/SymbolicToPure.ml
@@ -3861,7 +3861,12 @@ let translate_fun_decl (ctx : bs_ctx) (body : S.expression option) : fun_decl =
def
let translate_type_decls (ctx : Contexts.decls_ctx) : type_decl list =
- List.map (translate_type_decl ctx)
+ List.filter_map
+ (fun a ->
+ try Some (translate_type_decl ctx a)
+ with CFailure (meta, _) ->
+ let () = save_error __FILE__ __LINE__ meta "Could not generate code, see previous error" in
+ None)
(TypeDeclId.Map.values ctx.type_ctx.type_decls)
let translate_trait_decl (ctx : Contexts.decls_ctx) (trait_decl : A.trait_decl)