@@ -26636,6 +26636,7 @@ and ext_status =
26636
26636
| Text_next (* not first constructor in an extension *)
26637
26637
| Text_exception
26638
26638
26639
+ val equal_tag : constructor_tag -> constructor_tag -> bool
26639
26640
end = struct
26640
26641
#1 "types.ml"
26641
26642
(***********************************************************************)
@@ -26946,6 +26947,15 @@ and ext_status =
26946
26947
| Text_next (* not first constructor of an extension *)
26947
26948
| Text_exception (* an exception *)
26948
26949
26950
+ let equal_tag t1 t2 =
26951
+ match (t1, t2) with
26952
+ | Cstr_constant i1, Cstr_constant i2 -> i2 = i1
26953
+ | Cstr_block i1, Cstr_block i2 -> i2 = i1
26954
+ | Cstr_extension (path1, b1), Cstr_extension (path2, b2) ->
26955
+ Path.same path1 path2 && b1 = b2
26956
+ | (Cstr_constant _|Cstr_block _|Cstr_extension _), _ -> false
26957
+
26958
+
26949
26959
end
26950
26960
module Btype : sig
26951
26961
#1 "btype.mli"
@@ -44011,7 +44021,7 @@ let rec compat p q =
44011
44021
| Tpat_tuple ps, Tpat_tuple qs -> compats ps qs
44012
44022
| Tpat_lazy p, Tpat_lazy q -> compat p q
44013
44023
| Tpat_construct (_, c1,ps1), Tpat_construct (_, c2,ps2) ->
44014
- c1.cstr_tag = c2.cstr_tag && compats ps1 ps2
44024
+ Types.equal_tag c1.cstr_tag c2.cstr_tag && compats ps1 ps2
44015
44025
| Tpat_variant(l1,Some p1, r1), Tpat_variant(l2,Some p2,_) ->
44016
44026
l1=l2 && compat p1 p2
44017
44027
| Tpat_variant (l1,None,r1), Tpat_variant(l2,None,_) ->
@@ -44192,7 +44202,7 @@ let pretty_matrix (pss : matrix) =
44192
44202
let simple_match p1 p2 =
44193
44203
match p1.pat_desc, p2.pat_desc with
44194
44204
| Tpat_construct(_, c1, _), Tpat_construct(_, c2, _) ->
44195
- c1.cstr_tag = c2.cstr_tag
44205
+ Types.equal_tag c1.cstr_tag c2.cstr_tag
44196
44206
| Tpat_variant(l1, _, _), Tpat_variant(l2, _, _) ->
44197
44207
l1 = l2
44198
44208
| Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
@@ -44680,7 +44690,7 @@ let complete_constrs p all_tags =
44680
44690
let constrs = get_variant_constructors p.pat_env c.cstr_res in
44681
44691
map_filter
44682
44692
(fun cnstr ->
44683
- if List.mem cnstr.cstr_tag not_tags then Some cnstr else None)
44693
+ if List.exists (fun tag -> Types.equal_tag tag cnstr.cstr_tag) not_tags then Some cnstr else None)
44684
44694
constrs
44685
44695
| _ -> fatal_error "Parmatch.complete_constr"
44686
44696
@@ -45391,7 +45401,7 @@ let rec le_pat p q =
45391
45401
| _, Tpat_alias(q,_,_) -> le_pat p q
45392
45402
| Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
45393
45403
| Tpat_construct(_,c1,ps), Tpat_construct(_,c2,qs) ->
45394
- c1.cstr_tag = c2.cstr_tag && le_pats ps qs
45404
+ Types.equal_tag c1.cstr_tag c2.cstr_tag && le_pats ps qs
45395
45405
| Tpat_variant(l1,Some p1,_), Tpat_variant(l2,Some p2,_) ->
45396
45406
(l1 = l2 && le_pat p1 p2)
45397
45407
| Tpat_variant(l1,None,r1), Tpat_variant(l2,None,_) ->
@@ -45441,7 +45451,7 @@ let rec lub p q = match p.pat_desc,q.pat_desc with
45441
45451
let r = lub p q in
45442
45452
make_pat (Tpat_lazy r) p.pat_type p.pat_env
45443
45453
| Tpat_construct (lid, c1,ps1), Tpat_construct (_,c2,ps2)
45444
- when c1.cstr_tag = c2.cstr_tag ->
45454
+ when Types.equal_tag c1.cstr_tag c2.cstr_tag ->
45445
45455
let rs = lubs ps1 ps2 in
45446
45456
make_pat (Tpat_construct (lid, c1,rs))
45447
45457
p.pat_type p.pat_env
0 commit comments