-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test: show locate failing in record punning
in presence of a shadowing definition
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |