Skip to content

Commit

Permalink
Avoid stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored and Simn committed Oct 20, 2023
1 parent 69e6126 commit 255d5dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/typing/tanon_identification.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ open Globals
open Type

let replace_mono t =
let visited_anons = ref [] in
let rec loop t =
match t with
| TMono ({ tm_type = None } as tmono) ->
Monomorph.bind tmono t_dynamic
| TAnon an ->
if not (List.memq an !visited_anons) then begin
visited_anons := an :: !visited_anons;
TFunctions.iter loop t
end
| _ ->
TFunctions.iter loop t
in
Expand Down

0 comments on commit 255d5dd

Please sign in to comment.