Skip to content

Commit

Permalink
Update to OCaml 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Apr 8, 2024
1 parent a903b91 commit c84ab73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
===== dev =====
* Update to OCaml 5.2

===== 10.4.0 (2024-03-22) =====
* Basic client-server distillery template: sqlite is now the default backend
* Basic template now has license unlicense
Expand Down
11 changes: 9 additions & 2 deletions src/ppx/ppx_eliom_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ module Cmo = struct

let events = lazy (load ())

let label_of_string s =
let [@ocaml.warning "-32"] label_of_string s =
if s = ""
then Asttypes.Nolabel
else if s.[0] = '?'
Expand Down Expand Up @@ -351,7 +351,14 @@ module Cmo = struct
let rec type_of_out_type ty =
match ty with
| Otyp_var (_, s) -> Typ.var (var s)
| Otyp_arrow (lab, ty1, ty2) ->
| ((Otyp_arrow (lab, ty1, ty2)) [@if ocaml_version >= (5, 2, 0)]) ->
let lab = match lab with
| Nolabel -> Nolabel
| Labelled lab -> Labelled lab
| Optional lab -> Optional lab
in
Typ.arrow lab (type_of_out_type ty1) (type_of_out_type ty2)
| ((Otyp_arrow (lab, ty1, ty2)) [@if ocaml_version < (5, 2, 0)]) ->
Typ.arrow (label_of_string lab) (type_of_out_type ty1)
(type_of_out_type ty2)
| Otyp_tuple tyl -> Typ.tuple (List.map type_of_out_type tyl)
Expand Down

0 comments on commit c84ab73

Please sign in to comment.