Skip to content

Commit

Permalink
[hxb] writer: avoid side effects on TAnon fields type
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Oct 11, 2023
1 parent 19d4997 commit e902980
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/typing/tanon_identification.ml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
open Globals
open Type

let rec replace_mono t =
match t with
| TMono t ->
(match t.tm_type with
| None -> Monomorph.bind t t_dynamic
| Some _ -> ())
| TEnum (_,p) | TInst (_,p) | TType (_,p) | TAbstract (_,p) ->
List.iter replace_mono p
| TFun (args,ret) ->
List.iter (fun (_,_,t) -> replace_mono t) args;
replace_mono ret
| TAnon _
| TDynamic _ -> ()
| TLazy f ->
replace_mono (lazy_type f)
let replace_mono t =
let rec loop t =
match t with
| TMono ({ tm_type = None } as tmono) ->
Monomorph.bind tmono t_dynamic
| _ ->
TFunctions.iter loop t
in
loop t

type 'a path_field_mapping = {
pfm_path : path;
Expand Down

0 comments on commit e902980

Please sign in to comment.