This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,21 @@
$ cat >dune-project <<EOF
> (lang dune 3.3)
> EOF
$ mkdir vlib impl
$ touch vlib/foo.mli
$ cat >vlib/dune <<EOF
> (library
> (name foo)
> (virtual_modules foo)
> (wrapped false))
> EOF
$ touch impl/foo.ml impl/new_public_module.ml
$ cat >impl/dune <<EOF
> (library
> (name bar)
> (implements foo))
> EOF
$ dune build

View file

@ -0,0 +1 @@
let run () = print_endline "implementing bar"

View file

@ -0,0 +1 @@
(* this module isn't allowed as it introduces a new interface *)

View file

@ -0,0 +1,3 @@
(library
(name foo_impl)
(implements foo))

View file

@ -0,0 +1,12 @@
Implementations cannot introduce new modules to the library's interface
$ dune build
File "impl/dune", lines 1-3, characters 0-44:
1 | (library
2 | (name foo_impl)
3 | (implements foo))
Error: Implementations of wrapped libraries cannot introduce new public
modules.
The following modules:
- Baz
must all be marked as private using the (private_modules ..) field.
[1]

View file

@ -0,0 +1,3 @@
(library
(name foo)
(virtual_modules bar))