Skip to content

Commit a7d520e

Browse files
committed
Fix incompatibility with OCaml 5.4
The type of long idents changed in OCaml 5.4. Instead of building longidents by hand, use the `Longident.unflatten` API, which has been available since OCaml 4.06. Fixes: #45
1 parent 1561698 commit a7d520e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

toplevel/num_top.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
1515
*)
1616

17-
open Longident
18-
1917
let printers = [
2018
"nat_printer";
2119
"big_int_printer";
@@ -24,8 +22,9 @@ let printers = [
2422
]
2523

2624
let install_num_printer s =
27-
Topdirs.dir_install_printer Format.err_formatter
28-
(Ldot(Lident "Num_top_printers", s))
25+
match Longident.unflatten ["Num_top_printers"; s] with
26+
| None -> assert false
27+
| Some lid -> Topdirs.dir_install_printer Format.err_formatter lid
2928

3029
let _ =
3130
List.iter install_num_printer printers

0 commit comments

Comments
 (0)