Skip to content

Commit

Permalink
Merge pull request #169 from lthls/ocaml5.2
Browse files Browse the repository at this point in the history
Add support for OCaml 5.2
  • Loading branch information
AltGr committed Feb 8, 2024
2 parents a4631a9 + 60358ea commit 2a24807
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libs/indexBuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion libs/indexPredefined.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a24807

Please sign in to comment.