Skip to content

Commit

Permalink
add test: show locate failing in record punning
Browse files Browse the repository at this point in the history
in presence of a shadowing definition
  • Loading branch information
Ulugbek authored and voodoos committed Jul 4, 2023
1 parent de7767b commit 5486a9d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/test-dirs/locate/record_pun.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
############
With punning
############

$ cat > func.ml <<EOF
> module M = struct
> type t = { foo : int }
>
> let foo = 42
> end
>
> let foo = 43
>
> let m = { M.foo }
>
> EOF
With punning we jump to the definition of the value and not the record:
$ $MERLIN single locate -look-for ml -position 9:14 \
> -filename ./func.ml < ./func.ml |
> jq '.value.pos'
{
"line": 4,
"col": 6
}
###############
Without punning
###############
$ cat > func.ml <<EOF
> module M = struct
> type t = { foo : int }
>
> let foo = 42
> end
>
> let foo = 43
>
> let m = { M.foo }
>
> EOF
FIXME should jump to the re-definition of `foo` line 7
$ $MERLIN single locate -look-for ml -position 9:14 \
> -filename ./func.ml < ./func.ml |
> jq '.value.pos'
{
"line": 4,
"col": 6
}

0 comments on commit 5486a9d

Please sign in to comment.