this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix odoc build with OCaml 5.4.1: Data_types module migration

In OCaml 5.4.1, constructor_description and label_description moved
from Types to Data_types. Add cppo guard for >= (5, 4, 0) that uses
Data_types.cstr_res_type_path and Data_types.lbl_res_type_path
helpers instead of manually matching on Types.get_desc.

This only affects the local occurrence-tracking extensions
(Texp_construct, Texp_field, Tpat_construct matching) which are
not in upstream ocaml/odoc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+7 -2
+7 -2
src/loader/typedtree_traverse.cppo.ml
··· 10 10 | Type of Path.t 11 11 12 12 (** Extract the type path from a constructor_description's result type. *) 13 + #if OCAML_VERSION >= (5, 4, 0) 14 + let type_path_of_constructor_desc (cstr : Data_types.constructor_description) = 15 + Some (Data_types.cstr_res_type_path cstr) 16 + let type_path_of_label_desc (lbl : Data_types.label_description) = 17 + Some (Data_types.lbl_res_type_path lbl) 18 + #else 13 19 let type_path_of_constructor_desc (cstr : Types.constructor_description) = 14 20 match Types.get_desc cstr.cstr_res with 15 21 | Tconstr (p, _, _) -> Some p 16 22 | _ -> None 17 - 18 - (** Extract the type path from a label_description's result type. *) 19 23 let type_path_of_label_desc (lbl : Types.label_description) = 20 24 match Types.get_desc lbl.lbl_res with 21 25 | Tconstr (p, _, _) -> Some p 22 26 | _ -> None 27 + #endif 23 28 24 29 let expr poses expr = 25 30 let exp_loc = expr.Typedtree.exp_loc in