Skip to content

Commit dcb1e41

Browse files
committed
test: renaming a functor value included from its parameter
1 parent 266c435 commit dcb1e41

File tree

6 files changed

+51
-0
lines changed

6 files changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(executable
2+
(name main))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 3.17)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module type P = sig val txt : string end
2+
3+
module Make (Params : sig val txt : string end) = struct
4+
include Params
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module type P = sig val txt : string end
2+
3+
module Make (_ : P) : sig
4+
include P
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module P = struct let txt = "Hello world!" end;;
2+
module M = Func.Make(P);;
3+
4+
print_endline M.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
$ $DUNE build @ocaml-index
3+
4+
$ $DUNE exec ./main.exe
5+
Hello world!
6+
7+
We expect 2 occurrences in func.ml, 1 in func.mli and 2 in main.ml
8+
$ $MERLIN single occurrences -scope renaming -identifier-at 4:18 \
9+
> -filename main.ml <main.ml | jq '.value[] | .file,.start'
10+
"$TESTCASE_ROOT/main.ml"
11+
{
12+
"line": 1,
13+
"col": 22
14+
}
15+
"$TESTCASE_ROOT/func.ml"
16+
{
17+
"line": 1,
18+
"col": 24
19+
}
20+
"$TESTCASE_ROOT/func.ml"
21+
{
22+
"line": 3,
23+
"col": 30
24+
}
25+
"$TESTCASE_ROOT/func.mli"
26+
{
27+
"line": 1,
28+
"col": 24
29+
}
30+
"$TESTCASE_ROOT/main.ml"
31+
{
32+
"line": 4,
33+
"col": 16
34+
}

0 commit comments

Comments
 (0)