Skip to content

Commit

Permalink
test: show locate failing in presence of same name definition in reco…
Browse files Browse the repository at this point in the history
…rd punning (#1440)

from ulugbekna/record-pun-locate
  • Loading branch information
voodoos committed Jul 7, 2023
2 parents 44387ae + 5486a9d commit be47f1f
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 be47f1f

Please sign in to comment.