From 60358ea6e79bf1cfc65509bf4c30ea49f48d48d0 Mon Sep 17 00:00:00 2001 From: Vincent Laviron Date: Thu, 8 Feb 2024 01:12:09 +0100 Subject: [PATCH] Add support for OCaml 5.2 --- libs/indexBuild.ml | 4 ++++ libs/indexPredefined.ml | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/indexBuild.ml b/libs/indexBuild.ml index 6dc1d88..a40a5e4 100644 --- a/libs/indexBuild.ml +++ b/libs/indexBuild.ml @@ -447,7 +447,11 @@ let make_type_expr ~desc ~level ~id = let trie_of_type_decl ?comments info ty_decl = match ty_decl.Types.type_kind with +#if OCAML_VERSION >= (5,2,0) + | Types.Type_abstract _ -> [], comments +#else | Types.Type_abstract -> [], comments +#endif | Types.Type_open -> [], comments | Types.Type_record (fields,_repr) -> List.map diff --git a/libs/indexPredefined.ml b/libs/indexPredefined.ml index 64e1f40..2b57919 100644 --- a/libs/indexPredefined.ml +++ b/libs/indexPredefined.ml @@ -31,7 +31,13 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { name = name; ty = Some (Osig_type ( { otype_name = name; - #if OCAML_VERSION >= (4,12,0) + #if OCAML_VERSION >= (5,2,0) + otype_params = List.map (fun v -> + { ot_non_gen = false; + ot_name = v; + ot_variance = Asttypes.(NoVariance, NoInjectivity) } + ) params; + #elif OCAML_VERSION >= (4,12,0) otype_params = List.map (fun v -> v,Asttypes.(NoVariance, NoInjectivity)) params; #else otype_params = List.map (fun v -> v,(true,true)) params;