-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle case of missing
.cmj
when trying to inline external fie…
…ld (#1067) * test: add failing test * fix: handle case of missing `.cmj` when trying to inline external field * chore: add changelog entry * test: snapshot test after fix * fix: bail in more places when we can't perform cross-module inlining * remove unused signature from the .mli * chore: move comment
- Loading branch information
1 parent
1085376
commit b409141
Showing
8 changed files
with
116 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
$ . ./setup.sh | ||
$ cat > dune-project <<EOF | ||
> (lang dune 3.9) | ||
> (using melange 0.1) | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (alias mel) | ||
> (modules x) | ||
> (emit_stdlib false) | ||
> (libraries vlib impl_melange)) | ||
> EOF | ||
$ mkdir impl_melange vlib | ||
$ cat > vlib/dune <<EOF | ||
> (library | ||
> (name vlib) | ||
> (wrapped false) | ||
> (modes melange) | ||
> (virtual_modules virt)) | ||
> EOF | ||
$ cat > vlib/virt.mli <<EOF | ||
> val t : string | ||
> EOF | ||
$ cat > vlib/vlib.ml <<EOF | ||
> let hello = "Hello from " ^ Virt.t | ||
> EOF | ||
$ cat > impl_melange/dune <<EOF | ||
> (library | ||
> (name impl_melange) | ||
> (modes melange) | ||
> (implements vlib)) | ||
> EOF | ||
$ cat > impl_melange/virt.ml << EOF | ||
> let t = "melange" | ||
> EOF | ||
$ cat > x.ml <<EOF | ||
> let () = print_endline Vlib.hello | ||
> EOF | ||
$ dune build @mel --display=short | ||
ocamldep vlib/.vlib.objs/virt.intf.d | ||
ocamldep impl_melange/.impl_melange.objs/virt.impl.d | ||
ocamldep vlib/.vlib.objs/vlib.impl.d | ||
melc vlib/.vlib.objs/melange/virt.{cmi,cmti} | ||
melc vlib/.vlib.objs/melange/vlib.{cmi,cmj,cmt} | ||
melc impl_melange/.impl_melange.objs/melange/virt.{cmj,cmt} | ||
melc output/vlib/vlib.js | ||
melc .output.mobjs/melange/melange__X.{cmi,cmj,cmt} | ||
melc output/impl_melange/virt.js | ||
melc output/x.js | ||
$ output=_build/default/output/x.js | ||
$ node "$output" | ||
Hello from melange |