From 5286b42f58d4f516d987ed8ac92ecf5a3791978b Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Fri, 9 Mar 2018 17:43:27 +0000 Subject: [PATCH] Fix #597 --- CHANGES.md | 4 ++++ src/module_compilation.ml | 2 +- test/blackbox-tests/test-cases/github597/run.t | 6 ------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0d7b5d73..4fe58aac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,10 @@ next generic and should support several inline test systems such as `ppx_inline_test`, `ppx_expect` or `qtest` (#547) +- Make sure modules in the current directory always have precedence + over included directories (#597) + + 1.0+beta18 (25/02/2018) ----------------------- diff --git a/src/module_compilation.ml b/src/module_compilation.ml index 384791a5..cd58effb 100644 --- a/src/module_compilation.ml +++ b/src/module_compilation.ml @@ -95,12 +95,12 @@ let build_cm sctx ?sandbox ~dynlink ~flags ~cm_kind ~dep_graphs ~extra_targets [ Dyn (fun (_, ocaml_flags) -> As ocaml_flags) ; cmt_args + ; A "-I"; Path obj_dir ; Dyn (fun (libs, _) -> Lib.L.include_flags libs ~stdlib_dir:ctx.stdlib_dir) ; As extra_args ; if dynlink || cm_kind <> Cmx then As [] else A "-nodynlink" ; A "-no-alias-deps"; opaque - ; A "-I"; Path obj_dir ; (match alias_module with | None -> S [] | Some (m : Module.t) -> diff --git a/test/blackbox-tests/test-cases/github597/run.t b/test/blackbox-tests/test-cases/github597/run.t index d57c73cb..3ea2a86a 100644 --- a/test/blackbox-tests/test-cases/github597/run.t +++ b/test/blackbox-tests/test-cases/github597/run.t @@ -1,7 +1 @@ $ $JBUILDER build --root . -j1 --display quiet b/b.cma - ocamlc b/.b.objs/plop.{cmi,cmo,cmt} (exit 2) - (cd _build/default && /home/dim/.opam/4.05.0/bin/ocamlc.opt -w -40 -g -bin-annot -I a/.a.objs -no-alias-deps -I b/.b.objs -o b/.b.objs/plop.cmo -c -impl b/plop.ml) - File "b/plop.ml", line 1, characters 23-28: - Error: This expression has type int but an expression was expected of type - string - [1]