Skip to content

Commit

Permalink
Fix Ctype.begin_def etc in Opttopdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell committed Oct 31, 2023
1 parent 7d286fd commit fc694fe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions native_toplevel/opttopdirs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ let match_printer_type ppf desc typename =
fprintf ppf "Cannot find type Topdirs.%s.@." typename;
raise Exit
in
Ctype.begin_def();
let ty_arg = Ctype.newvar (Jkind.value ~why:Debug_printer_argument) in
Ctype.unify !toplevel_env
(Ctype.newconstr printer_type [ty_arg])
(Ctype.instance desc.val_type);
Ctype.end_def();
Ctype.generalize ty_arg;
ty_arg
Ctype.with_local_level ~post:Ctype.generalize (fun () ->
let ty_arg = Ctype.newvar (Jkind.value ~why:Debug_printer_argument) in
Ctype.unify !toplevel_env
(Ctype.newconstr printer_type [ty_arg])
(Ctype.instance desc.val_type);
ty_arg)

let find_printer_type ppf lid =
match Env.find_value_by_name lid !toplevel_env with
Expand Down

0 comments on commit fc694fe

Please sign in to comment.