Skip to content

Commit

Permalink
melange: add workaround with preprocess
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Chávarri <[email protected]>
  • Loading branch information
jchavarri committed Mar 15, 2023
1 parent 6bc6360 commit ba30e9b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/blackbox-tests/test-cases/melange/library-cmi-consistency.t
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ and B (transitive)
make inconsistent assumptions over interface My_lib__D
[1]

Now replace modules with melange-ppx-less code
Replacing modules with melange-ppx-less code fixes the issue

$ cat > lib/b.ml <<EOF
> let t = C.t
Expand All @@ -79,3 +79,25 @@ Now replace modules with melange-ppx-less code
> EOF

$ dune build @mel

Also, using disabling melange builtin ppx and using preprocess fixes the problem

$ cat > lib/b.ml <<EOF
> let t = [%bs.obj { a = C.t }]
> EOF

$ cat > lib/c.ml <<EOF
> type t = < a : D.t >
> let t: < a : D.t > = [%bs.obj { a = D.t }]
> EOF

$ cat > lib/dune <<EOF
> (library
> (name my_lib)
> (preprocess
> (action (run melc --as-pp %{input-file})))
> (melange.compile_flags :standard --bs-no-builtin-ppx)
> (modes melange))
> EOF

$ dune build @mel

0 comments on commit ba30e9b

Please sign in to comment.