Skip to content

Commit

Permalink
test: renaming a functor value included from its parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Jan 9, 2025
1 parent 0e118c5 commit 9c701c3
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(executable
(name main))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.17)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module type P = sig val txt : string end

module Make (Params : sig val txt : string end) = struct
include Params
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module type P = sig val txt : string end

module Make (_ : P) : sig
include P
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module P = struct let txt = "Hello world!" end;;
module M = Func.Make(P);;

print_endline M.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

$ $DUNE build @ocaml-index

$ $DUNE exec ./main.exe
Hello world!

We expect 2 occurrences in func.ml, 1 in func.mli and 2 in main.ml
$ $MERLIN single occurrences -scope renaming -identifier-at 4:18 \
> -filename main.ml <main.ml | jq '.value[] | .file,.start'
"$TESTCASE_ROOT/main.ml"
{
"line": 1,
"col": 22
}
"$TESTCASE_ROOT/func.ml"
{
"line": 1,
"col": 24
}
"$TESTCASE_ROOT/func.ml"
{
"line": 3,
"col": 30
}
"$TESTCASE_ROOT/func.mli"
{
"line": 1,
"col": 24
}
"$TESTCASE_ROOT/main.ml"
{
"line": 4,
"col": 16
}

0 comments on commit 9c701c3

Please sign in to comment.