Skip to content

Commit 343afbe

Browse files
committed
compat
Signed-off-by: Paul-Elliot <[email protected]>
1 parent 4efd65a commit 343afbe

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/loader/compat.cppo.ml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@ let get_type_desc = Types.get_desc
44
let get_type_desc t = t.Types.desc
55
#endif
66

7+
type 'a pattern =
8+
#if OCAML_VERSION >= (4,11,0)
9+
'a Typedtree.general_pattern
10+
#else
11+
Typedtree.pattern
12+
#endif
13+
14+
type 'a pattern_desc =
15+
#if OCAML_VERSION >= (4,11,0)
16+
'a Typedtree.pattern_desc
17+
#else
18+
Typedtree.pattern_desc
19+
#endif
20+
721
(** Extract longident and constructor description from a pattern construct,
822
when it is one. *)
9-
let get_pattern_construct_info (type a) : a Typedtree.pattern_desc -> _ = function
23+
let get_pattern_construct_info (type a) : a pattern_desc -> _ = function
1024
#if OCAML_VERSION >= (4,13,0)
11-
Typedtree.Tpat_construct (l, { cstr_res; _ }, _, _)
25+
| Typedtree.Tpat_construct (l, { cstr_res; _ }, _, _)
1226
#else
13-
Tpat_construct (l, { cstr_res; _ }, _)
27+
| Tpat_construct (l, { cstr_res; _ }, _)
1428
#endif
1529
-> Some (l, cstr_res)
1630
| _ -> None

src/loader/occurrences.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module Global_analysis = struct
5656
| _ -> ())
5757
| _ -> ()
5858

59-
let pat poses (type a) : a Typedtree.general_pattern -> unit = function
59+
let pat poses : _ Compat.pattern -> unit = function
6060
| { Typedtree.pat_desc; pat_loc; _ } -> (
6161
match Compat.get_pattern_construct_info pat_desc with
6262
| Some (l, cstr_res) -> (

0 commit comments

Comments
 (0)