Skip to content

Commit

Permalink
add support for OCaml 4.13
Browse files Browse the repository at this point in the history
  • Loading branch information
tatchi committed Jan 10, 2022
1 parent 261e053 commit 2acf481
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/compat/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +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)])
; ("init_path", [(4, 9)])
; ("env_lookup", [(4, 10)]) ]

Expand Down
3 changes: 3 additions & 0 deletions src/compat/types_type_kind_ge_000.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type type_kind_407 = Types.type_kind

let migrate_type_kind : Types.type_kind -> type_kind_407 = fun x -> x
11 changes: 11 additions & 0 deletions src/compat/types_type_kind_ge_413.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type ('lbl, 'cstr) type_kind_407 =
| 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_407 = function
| Type_abstract -> Type_abstract
| Type_record (lbl, repr) -> Type_record (lbl, repr)
| Type_variant (cstr, _) -> Type_variant cstr
| Type_open -> Type_open
2 changes: 1 addition & 1 deletion src/ppx_import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ let ptype_decl_of_ttype_decl ~manifest ~subst ptype_name
; pld_attributes = Tt.copy_attributes ld.ld_attributes })
in
Ppxlib.(
match ttype_decl.type_kind with
match Compat.migrate_type_kind ttype_decl.type_kind with
| Type_abstract -> Ptype_abstract
| Type_open -> Ptype_open
| Type_record (labels, _) -> Ptype_record (map_labels labels)
Expand Down

0 comments on commit 2acf481

Please sign in to comment.