Skip to content

Commit 8057ded

Browse files
authored
Prevent infinite recursion in TypeUtils.resolveTypeForPipeCompletion by not looping over type variables (#7731)
* Limit TypeUtils.resolveTypeForPipeCompletion to 10 recursive calls to prevent infinite loops * Add CHANGELOG entry * Add comment explaining why TypeUtils.resolveTypeForPipeCompletion enforces a maximum iteration count and add TODO about fixing the root of the issue * Prevent infinite recursion in TypeUtils.resolveTypeForPipeCompletion by not looping over type variables
1 parent b70e6ad commit 8057ded

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#### :bug: Bug fix
2424

2525
- Fix error message that falsely suggested using coercion when it wouldn't work. https://github.com/rescript-lang/rescript/pull/7721
26+
- Fix hang in `rescript-editor-analysis.exe codeAction` that sometimes prevented ReScript files from being saved in VS Code. https://github.com/rescript-lang/rescript/pull/7731
2627
- Fix formatter removes () from functor type. https://github.com/rescript-lang/rescript/pull/7735
2728
- Rewatch: don't compile dev-dependencies of non local dependencies with `--dev`. https://github.com/rescript-lang/rescript/pull/7736
2829

analysis/src/TypeUtils.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ let rec resolveTypeForPipeCompletion ~env ~package ~lhsLoc ~full
539539
| _ -> None
540540
in
541541
match typFromLoc with
542+
| Some ({desc = Tvar _} as t) -> (env, t)
542543
| Some typFromLoc ->
543544
typFromLoc |> resolveTypeForPipeCompletion ~lhsLoc ~env ~package ~full
544545
| None ->

0 commit comments

Comments
 (0)