-
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.
This should resolves short-path normalization hanging in some situations. > The paths that are not being included are weird ones used whilst checking type declarations that are recursive. Unlike almost all other type defunitions, they get mutated after they are added to an environment, and actually become invalid cyclic types. Since short-paths looks at the types lazily it sees the cyclic definition and blows up. This might be fixed upstream one day: ocaml/ocaml#9324
- Loading branch information
Showing
4 changed files
with
77 additions
and
13 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
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
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
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,56 @@ | ||
$ cat >test.ml <<'EOF' | ||
> module Id = struct | ||
> type 'a t = 'a | ||
> end | ||
> | ||
> module Unit = struct | ||
> type t = unit | ||
> end | ||
> | ||
> type 'a t = | ||
> | Id of 'a t Id.t | ||
> | Unit of Unit.t | ||
> EOF | ||
|
||
This query should not hang indefinitely | ||
$ $MERLIN single type-enclosing -position 11:17 -short-paths \ | ||
> -filename test.ml < test.ml | | ||
> jq '.value' | ||
[ | ||
{ | ||
"start": { | ||
"line": 11, | ||
"col": 12 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"col": 18 | ||
}, | ||
"type": "type t = unit", | ||
"tail": "no" | ||
}, | ||
{ | ||
"start": { | ||
"line": 11, | ||
"col": 12 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"col": 18 | ||
}, | ||
"type": "unit", | ||
"tail": "no" | ||
}, | ||
{ | ||
"start": { | ||
"line": 9, | ||
"col": 0 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"col": 18 | ||
}, | ||
"type": "type 'a t = Id of 'a t | Unit of unit", | ||
"tail": "no" | ||
} | ||
] |