Skip to content

Commit 75e471d

Browse files
authored
test(module-compilation): show missing location snippet for ppxed files (#12770)
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
1 parent 3bd3e26 commit 75e471d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Show PPX snippet preview is shown in Dune
2+
3+
$ mkdir -p lib
4+
$ cat > dune-project <<EOF
5+
> (lang dune 3.13)
6+
> (using melange 0.1)
7+
> EOF
8+
$ cat > lib/dune <<EOF
9+
> (library
10+
> (name the_lib)
11+
> (modes melange)
12+
> (preprocess (pps melange.ppx)))
13+
> EOF
14+
$ cat > lib/the_lib.ml <<EOF
15+
> let x: nope = "hello"
16+
> EOF
17+
18+
$ cat > dune <<EOF
19+
> (melange.emit
20+
> (target output)
21+
> (libraries the_lib)
22+
> (emit_stdlib false))
23+
> EOF
24+
25+
$ export DUNE_SANDBOX=symlink
26+
$ dune build @melange
27+
File "lib/the_lib.ml", line 1, characters 7-11:
28+
Error: Unbound type constructor nope
29+
[1]
30+
31+
Works if the sandbox is disabled
32+
33+
$ export DUNE_SANDBOX=none
34+
$ dune build @melange
35+
File "lib/the_lib.ml", line 1, characters 7-11:
36+
1 | let x: nope = "hello"
37+
^^^^
38+
Error: Unbound type constructor nope
39+
[1]
40+

0 commit comments

Comments
 (0)