From 261e053f97cc93abf8954f9818edc34e13fc01b4 Mon Sep 17 00:00:00 2001 From: tatchi Date: Mon, 10 Jan 2022 18:39:20 +0100 Subject: [PATCH 1/3] add OCaml 4.13 versions in CI --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4d76e7c..afcbe65 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -27,6 +27,8 @@ jobs: - 4.10.0 - 4.11.1 - 4.12.0 + - 4.13.0 + - 4.13.1 runs-on: ${{ matrix.os }} From 2acf48121e9eea42d073a4e3e0b5d888ad1da757 Mon Sep 17 00:00:00 2001 From: tatchi Date: Mon, 10 Jan 2022 18:49:35 +0100 Subject: [PATCH 2/3] add support for OCaml 4.13 --- src/compat/gen.ml | 1 + src/compat/types_type_kind_ge_000.ml | 3 +++ src/compat/types_type_kind_ge_413.ml | 11 +++++++++++ src/ppx_import.ml | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/compat/types_type_kind_ge_000.ml create mode 100644 src/compat/types_type_kind_ge_413.ml diff --git a/src/compat/gen.ml b/src/compat/gen.ml index bb8175b..1d318cf 100644 --- a/src/compat/gen.ml +++ b/src/compat/gen.ml @@ -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)]) ] diff --git a/src/compat/types_type_kind_ge_000.ml b/src/compat/types_type_kind_ge_000.ml new file mode 100644 index 0000000..809646d --- /dev/null +++ b/src/compat/types_type_kind_ge_000.ml @@ -0,0 +1,3 @@ +type type_kind_407 = Types.type_kind + +let migrate_type_kind : Types.type_kind -> type_kind_407 = fun x -> x diff --git a/src/compat/types_type_kind_ge_413.ml b/src/compat/types_type_kind_ge_413.ml new file mode 100644 index 0000000..d37b252 --- /dev/null +++ b/src/compat/types_type_kind_ge_413.ml @@ -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 diff --git a/src/ppx_import.ml b/src/ppx_import.ml index a6177c5..369f992 100644 --- a/src/ppx_import.ml +++ b/src/ppx_import.ml @@ -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) From 1f1c169018b5bca6dc3b118754277f391d3a5b51 Mon Sep 17 00:00:00 2001 From: tatchi Date: Tue, 11 Jan 2022 17:05:17 +0100 Subject: [PATCH 3/3] rename type_kind_407 to type_kind_412 --- src/compat/types_type_kind_ge_000.ml | 4 ++-- src/compat/types_type_kind_ge_413.ml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compat/types_type_kind_ge_000.ml b/src/compat/types_type_kind_ge_000.ml index 809646d..e3deb14 100644 --- a/src/compat/types_type_kind_ge_000.ml +++ b/src/compat/types_type_kind_ge_000.ml @@ -1,3 +1,3 @@ -type type_kind_407 = Types.type_kind +type type_kind_412 = Types.type_kind -let migrate_type_kind : Types.type_kind -> type_kind_407 = fun x -> x +let migrate_type_kind : Types.type_kind -> type_kind_412 = fun x -> x diff --git a/src/compat/types_type_kind_ge_413.ml b/src/compat/types_type_kind_ge_413.ml index d37b252..8d134f8 100644 --- a/src/compat/types_type_kind_ge_413.ml +++ b/src/compat/types_type_kind_ge_413.ml @@ -1,10 +1,10 @@ -type ('lbl, 'cstr) type_kind_407 = +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_407 = function +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