From bfeb18c839c5cb9edec9d7941f7b9325163489de Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 7 Jan 2025 15:36:30 +0000 Subject: [PATCH] Add support for OCaml 5.3 --- eliom.opam | 2 +- src/ppx/ppx_eliom_utils.ml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/eliom.opam b/eliom.opam index 590195fcf9..e5d6c84d2f 100644 --- a/eliom.opam +++ b/eliom.opam @@ -22,7 +22,7 @@ depends: [ "ocamlfind" "ppx_deriving" "ppxlib" {>= "0.15.0"} - "js_of_ocaml-compiler" {>= "5.5.0" & < "6.0.0"} + "js_of_ocaml-compiler" {>= "5.5.0"} "js_of_ocaml" {>= "5.5.0"} "js_of_ocaml-lwt" {>= "5.5.0"} "js_of_ocaml-ocamlbuild" {build} diff --git a/src/ppx/ppx_eliom_utils.ml b/src/ppx/ppx_eliom_utils.ml index c5df7d6dda..ac7c7e7ed1 100644 --- a/src/ppx/ppx_eliom_utils.ml +++ b/src/ppx/ppx_eliom_utils.ml @@ -453,9 +453,18 @@ module Cmo = struct in type_of_out_type ty + [%%if ocaml_version >= (5, 3, 0)] + let typ ty = + let ty = + Out_type.prepare_for_printing [ty]; + Out_type.tree_of_typexp Type_scheme ty + in + type_of_out_type ty + [%%else] let typ ty = let ty = Printtyp.tree_of_type_scheme ty in type_of_out_type ty + [%%endif] let find err loc = let {Lexing.pos_fname; pos_cnum; _} = loc.Location.loc_start in