Skip to content

Commit f4bf0ba

Browse files
tmcgilchristpanglesd
authored andcommitted
Handle differences in sig_class for OCaml 5.1.
Signed-off-by: Paul-Elliot <[email protected]>
1 parent de4d6d8 commit f4bf0ba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/loader/cmi.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,16 +1041,25 @@ and read_signature_noenv env parent (items : Odoc_model.Compat.signature) =
10411041
else shadowed
10421042
in
10431043
loop (ModuleType mtd :: acc, shadowed) rest
1044+
#if OCAML_VERSION < (5,1,0)
10441045
| Sig_class(id, cl, rec_status, _) :: Sig_class_type _
10451046
:: Sig_type _ :: Sig_type _ :: rest ->
1047+
#else
1048+
| Sig_class(id, cl, rec_status, _) :: Sig_class_type _
1049+
:: Sig_type _ :: rest ->
1050+
#endif
10461051
let cl = read_class_declaration env parent id cl in
10471052
let shadowed =
10481053
if Env.is_shadowed env id
10491054
then { shadowed with s_classes = Ident.name id :: shadowed.s_classes }
10501055
else shadowed
10511056
in
10521057
loop (Class (read_type_rec_status rec_status, cl)::acc, shadowed) rest
1058+
#if OCAML_VERSION < (5,1,0)
10531059
| Sig_class_type(id, cltyp, rec_status, _)::Sig_type _::Sig_type _::rest ->
1060+
#else
1061+
| Sig_class_type(id, cltyp, rec_status, _)::Sig_type _::rest ->
1062+
#endif
10541063
let cltyp = read_class_type_declaration env parent id cltyp in
10551064
let shadowed =
10561065
if Env.is_shadowed env id

0 commit comments

Comments
 (0)