Skip to content

Commit

Permalink
fix: do not hide lib interface module (#6549)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: f6931bc9-6cd8-4172-a865-fce524052fb7

Co-authored-by: Etienne Millon <[email protected]>
  • Loading branch information
rgrinberg and emillon authored Nov 24, 2022
1 parent 0a77fb9 commit 96fe384
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased
----------

- Do not shadow library interface modules (#6549, fixes #6545, @rgrinberg)

- Move `$ dune ocaml-merlin -dump-config=$dir` to `$ dune ocaml merlin
dump-config $dir`. (#6547, @rgrinberg)

Expand Down
5 changes: 4 additions & 1 deletion src/dune_rules/module_compilation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,10 @@ module Alias_module = struct
{ local_name; obj_name })
in
let shadowed =
if Dune_project.dune_version project < (3, 5) then []
if
Dune_project.dune_version project < (3, 5)
|| Modules.lib_interface modules = None
then []
else
match Modules.alias_module modules with
| None -> []
Expand Down
3 changes: 0 additions & 3 deletions test/blackbox-tests/test-cases/alias-module-generated.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ wrap module is generated by dune.

(** @canonical Foo.Bar *)
module Bar = Foo__Bar

module Foo = struct end
[@@deprecated "this module is shadowed"]

The final `Foo` module should not be marked as deprecated/shadowed, since it
does not shadow any module.

0 comments on commit 96fe384

Please sign in to comment.