From 278efc9196daedc8c57781a05ad8e5742a77e888 Mon Sep 17 00:00:00 2001 From: Leo White Date: Wed, 4 Nov 2015 11:00:21 +0000 Subject: Use ignore because its less fragile than _ --- typing/env.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/typing/env.ml b/typing/env.ml index 5c8315d2bd..ca5093a968 100644 --- a/typing/env.ml +++ b/typing/env.ml @@ -387,16 +387,17 @@ let find_pers_struct check name = (* Emits a warning if there is no valid cmi for name *) let check_pers_struct name = - match find_pers_struct false name with - | _ -> () - | exception Not_found -> + try + ignore (find_pers_struct false name) + with + | Not_found -> let warn = Warnings.No_cmi_file(name, None) in Location.prerr_warning Location.none warn - | exception Cmi_format.Error err -> + | Cmi_format.Error err -> let msg = Format.asprintf "%a" Cmi_format.report_error err in let warn = Warnings.No_cmi_file(name, Some msg) in Location.prerr_warning Location.none warn - | exception Error err -> + | Error err -> let msg = match err with | Illegal_renaming(name, ps_name, filename) -> -- cgit v1.2.1