From 777a5b9d5e53be72c9a84a641d60e38296379171 Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Tue, 11 Jul 2023 08:09:10 +0200 Subject: [PATCH] [typer] don't add empty import modules to com.modules --- src/typing/typeloadModule.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/typing/typeloadModule.ml b/src/typing/typeloadModule.ml index 5b3a4cc7730..d9e2e62c8f3 100644 --- a/src/typing/typeloadModule.ml +++ b/src/typing/typeloadModule.ml @@ -294,7 +294,6 @@ module ModuleLevel = struct (* We use the file path as module name to make it unique. This may or may not be a good idea... *) let m_import = make_module ctx ([],path) path p in m_import.m_extra.m_kind <- MImport; - add_module ctx m_import p; m_import in List.fold_left (fun acc path -> @@ -310,7 +309,9 @@ module ModuleLevel = struct | ParseError(_,(msg,p),_) -> Parser.error msg p in List.iter (fun (d,p) -> match d with EImport _ | EUsing _ -> () | _ -> raise_typing_error "Only import and using is allowed in import.hx files" p) r; - add_dependency m (make_import_module path r); + let m_import = make_import_module path r in + add_module ctx m_import p; + add_dependency m m_import; r end else begin let r = [] in