Skip to content

Commit

Permalink
Handle differences in sig_class for OCaml 5.1.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul-Elliot <[email protected]>
  • Loading branch information
tmcgilchrist authored and panglesd committed Oct 26, 2023
1 parent fc1ea9e commit 37b88dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/loader/cmi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,16 +1041,25 @@ and read_signature_noenv env parent (items : Odoc_model.Compat.signature) =
else shadowed
in
loop (ModuleType mtd :: acc, shadowed) rest
#if OCAML_VERSION < (5,1,0)
| Sig_class(id, cl, rec_status, _) :: Sig_class_type _
:: Sig_type _ :: Sig_type _ :: rest ->
#else
| Sig_class(id, cl, rec_status, _) :: Sig_class_type _
:: Sig_type _ :: rest ->
#endif
let cl = read_class_declaration env parent id cl in
let shadowed =
if Env.is_shadowed env id
then { shadowed with s_classes = Ident.name id :: shadowed.s_classes }
else shadowed
in
loop (Class (read_type_rec_status rec_status, cl)::acc, shadowed) rest
#if OCAML_VERSION < (5,1,0)
| Sig_class_type(id, cltyp, rec_status, _)::Sig_type _::Sig_type _::rest ->
#else
| Sig_class_type(id, cltyp, rec_status, _)::Sig_type _::rest ->
#endif
let cltyp = read_class_type_declaration env parent id cltyp in
let shadowed =
if Env.is_shadowed env id
Expand Down

0 comments on commit 37b88dc

Please sign in to comment.