diff --git a/CHANGES.md b/CHANGES.md index b058076..35b9422 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,8 @@ Unreleased type%import loc = Location.t ``` + * Support for OCaml 5.2 (#94, @kit-ty-kate) + 1.10.0 ------ diff --git a/src/compat/gen.ml b/src/compat/gen.ml index f2ba26b..9a6c75a 100644 --- a/src/compat/gen.ml +++ b/src/compat/gen.ml @@ -14,7 +14,7 @@ let make_version ~version f_prefix = let include_table = [ ("types_module_type", [(4, 10); (4, 8)]) ; ("types_signature_item", [(4, 8)]) - ; ("types_type_kind", [(4, 13)]) + ; ("types_type_kind", [(5, 2); (4, 13)]) ; ("init_path", [(4, 9)]) ; ("env_lookup", [(4, 10)]) ; ("types_desc", [(4, 14)]) ] diff --git a/src/compat/types_type_kind_ge_502.ml b/src/compat/types_type_kind_ge_502.ml new file mode 100644 index 0000000..4343a13 --- /dev/null +++ b/src/compat/types_type_kind_ge_502.ml @@ -0,0 +1,12 @@ +type ('lbl, 'cstr) type_kind_412 = + | Type_abstract + | Type_record of 'lbl list * Types.record_representation + | Type_variant of 'cstr list + | Type_open + +let migrate_type_kind : + ('lbl, 'cstr) Types.type_kind -> ('lbl, 'cstr) type_kind_412 = function + | Type_abstract _ -> Type_abstract + | Type_record (lbl, repr) -> Type_record (lbl, repr) + | Type_variant (cstr, _) -> Type_variant cstr + | Type_open -> Type_open