Skip to content

Commit

Permalink
test: modules and private_modules (ocaml#7023)
Browse files Browse the repository at this point in the history
demonstrate the behavior when a module is listed by (private_modules ..)
but is exlucded by (modules ..)

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Feb 8, 2023
1 parent 808a0e0 commit 425895a
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Demonstrate the behavior when a module is listed by private_modules by not by
modules:

$ cat >dune-project <<EOF
> (lang dune 3.7)
> EOF
$ cat >dune <<EOF
> (library
> (name foo)
> (wrapped false)
> (modules y)
> (private_modules x))
> EOF
$ cat >x.ml <<EOF
> let foo = ()
> EOF
$ cat >y.ml <<EOF
> let () = X.foo ()
> EOF
X is silently ignored:
$ dune build
File "y.ml", line 1, characters 9-14:
1 | let () = X.foo ()
^^^^^
Error: Unbound module X
[1]

0 comments on commit 425895a

Please sign in to comment.