Skip to content

Commit 9c27e68

Browse files
committed
Mark where the stack overflow happens.
1 parent 9782427 commit 9c27e68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

analysis/src/PrintType.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
let printExpr ?(lineWidth = 60) typ =
22
Printtyp.reset_names ();
3+
try
34
Res_doc.toString ~width:lineWidth
4-
(Res_outcome_printer.printOutTypeDoc (Printtyp.tree_of_typexp false typ))
5+
(Res_outcome_printer.printOutTypeDoc (Printtyp.tree_of_typexp false typ (* HERE *)))
6+
with _ -> "Error: could not print type"
57

68
let printDecl ?printNameAsIs ~recStatus name decl =
79
Printtyp.reset_names ();
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Hover src/PolyRec.res 12:10
2-
Fatal error: exception Stack overflow
2+
{"contents": {"kind": "markdown", "value": "```rescript\nError: could not print type\n```"}}
3+

0 commit comments

Comments
 (0)