From ec9ff813ad96ed5df5ecd54f04533d45e32cbc7a Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Thu, 12 Apr 2018 16:50:44 +0200 Subject: [PATCH] Fallback to implementation if there is no mli --- src/ocamldep.ml | 10 +++++++--- test/blackbox-tests/test-cases/github660/run.t | 5 ++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ocamldep.ml b/src/ocamldep.ml index fc4a12e1..b43117e4 100644 --- a/src/ocamldep.ml +++ b/src/ocamldep.ml @@ -139,9 +139,13 @@ let rules ~(ml_kind:Ml_kind.t) ~dir ~modules ); let build_paths dependencies = let dependency_file_path m = - Option.map - (Module.file ~dir m Ml_kind.Intf) - ~f:all_deps_path + let path = + match Module.file ~dir m Ml_kind.Intf with + | Some _ as x -> x + | None when Option.is_some alias_module -> None + | None -> Module.file ~dir m Ml_kind.Impl + in + Option.map path ~f:all_deps_path in List.filter_map dependencies ~f:dependency_file_path in diff --git a/test/blackbox-tests/test-cases/github660/run.t b/test/blackbox-tests/test-cases/github660/run.t index ed5c2704..2b37f52e 100644 --- a/test/blackbox-tests/test-cases/github660/run.t +++ b/test/blackbox-tests/test-cases/github660/run.t @@ -16,6 +16,5 @@ to rely on these. hello $ echo 'let x = 1' >> no-interfaces/lib_sub.ml $ jbuilder runtest --root no-interfaces --display quiet -j1 2>&1 | grep -v Entering | grep -v ocamlopt - File "_none_", line 1: - Error: Files .main.eobjs/main.cmx and .main.eobjs/lib_sub.cmx - make inconsistent assumptions over interface Lib_sub + main alias runtest + hello