Improve module error messages

This commit is contained in:
Louis Gesbert 2023-08-31 10:41:57 +02:00
parent e75ea3da07
commit ff60aee5ef
2 changed files with 5 additions and 5 deletions

View File

@ -172,8 +172,8 @@ let rec disambiguate_constructor
let modname = ModuleName.of_string modname in let modname = ModuleName.of_string modname in
match ModuleName.Map.find_opt modname ctxt.modules with match ModuleName.Map.find_opt modname ctxt.modules with
| None -> | None ->
Message.raise_spanned_error mpos "Module %a not found" ModuleName.format Message.raise_spanned_error mpos "Module \"%a\" not found"
modname ModuleName.format modname
| Some ctxt -> | Some ctxt ->
let constructor = let constructor =
List.map (Mark.map (fun (_, c) -> path, c)) constructor0 List.map (Mark.map (fun (_, c) -> path, c)) constructor0
@ -419,7 +419,7 @@ let rec translate_expr
let modname = ModuleName.of_string modname in let modname = ModuleName.of_string modname in
match ModuleName.Map.find_opt modname ctxt.modules with match ModuleName.Map.find_opt modname ctxt.modules with
| None -> | None ->
Message.raise_spanned_error mpos "Module %a not found" Message.raise_spanned_error mpos "Module \"%a\" not found"
ModuleName.format modname ModuleName.format modname
| Some ctxt -> get_str ctxt path) | Some ctxt -> get_str ctxt path)
in in

View File

@ -258,8 +258,8 @@ let rec module_ctx ctxt path =
let modname = ModuleName.of_string modname in let modname = ModuleName.of_string modname in
match ModuleName.Map.find_opt modname ctxt.modules with match ModuleName.Map.find_opt modname ctxt.modules with
| None -> | None ->
Message.raise_spanned_error mpos "Module %a not found" ModuleName.format Message.raise_spanned_error mpos "Module \"%a\" not found"
modname ModuleName.format modname
| Some ctxt -> module_ctx ctxt path) | Some ctxt -> module_ctx ctxt path)
(** {1 Declarations pass} *) (** {1 Declarations pass} *)