Skip to content

Commit

Permalink
Fallback to implementation if there is no mli
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Apr 12, 2018
1 parent bd33898 commit 8c1f10f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/ocamldep.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,18 @@ let rules ~(ml_kind:Ml_kind.t) ~dir ~modules
~dir ~file ~unit ~modules ~alias_module
~lib_interface_module ~strict:true lines
in
let mli_d_path m =
Option.map
(Module.file ~dir m Ml_kind.Intf)
~f:ocamldep_output_path
let dependency_file_path m =
let path =
match Module.file ~dir m Ml_kind.Intf with
| Some x -> Some x
| None when Option.is_some alias_module -> None
| None -> Module.file ~dir m Ml_kind.Impl
in
Option.map path ~f:ocamldep_output_path
in
let paths =
[ocamldep_output]
@ List.filter_map dependencies ~f:mli_d_path
@ List.filter_map dependencies ~f:dependency_file_path
in
paths
in
Expand Down
5 changes: 2 additions & 3 deletions test/blackbox-tests/test-cases/github660/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c1f10f

Please sign in to comment.