@@ -305,20 +305,6 @@ let extract_label_names sexp env ty =
305
305
with Not_found ->
306
306
assert false
307
307
308
- let explicit_arity =
309
- List. exists
310
- (function
311
- | ({txt ="ocaml.explicit_arity" |"explicit_arity" ; _} , _ ) -> true
312
- | _ -> false
313
- )
314
-
315
- let warn_on_literal_pattern =
316
- List. exists
317
- (function
318
- | ({txt ="ocaml.warn_on_literal_pattern" |"warn_on_literal_pattern" ; _} , _ ) -> true
319
- | _ -> false
320
- )
321
-
322
308
(* Typing of patterns *)
323
309
324
310
(* unification inside type_pat*)
@@ -1115,7 +1101,8 @@ let rec type_pat ~constrs ~labels ~no_existentials ~mode ~explode ~env
1115
1101
match sarg with
1116
1102
None -> []
1117
1103
| Some {ppat_desc = Ppat_tuple spl} when
1118
- constr.cstr_arity > 1 || explicit_arity sp.ppat_attributes
1104
+ constr.cstr_arity > 1 ||
1105
+ Builtin_attributes. explicit_arity sp.ppat_attributes
1119
1106
-> spl
1120
1107
| Some ({ppat_desc = Ppat_any } as sp ) when constr.cstr_arity <> 1 ->
1121
1108
if constr.cstr_arity = 0 then
@@ -1124,9 +1111,11 @@ let rec type_pat ~constrs ~labels ~no_existentials ~mode ~explode ~env
1124
1111
replicate_list sp constr.cstr_arity
1125
1112
| Some sp -> [sp] in
1126
1113
begin match sargs with
1127
- | [{ppat_desc = Ppat_constant _} as sp] when warn_on_literal_pattern constr.cstr_attributes ->
1128
- Location. prerr_warning sp.ppat_loc
1129
- Warnings. Fragile_literal_pattern
1114
+ | [{ppat_desc = Ppat_constant _} as sp]
1115
+ when Builtin_attributes. warn_on_literal_pattern
1116
+ constr.cstr_attributes ->
1117
+ Location. prerr_warning sp.ppat_loc
1118
+ Warnings. Fragile_literal_pattern
1130
1119
| _ -> ()
1131
1120
end ;
1132
1121
if List. length sargs <> constr.cstr_arity then
@@ -3557,7 +3546,7 @@ and type_construct env loc lid sarg ty_expected attrs =
3557
3546
match sarg with
3558
3547
None -> []
3559
3548
| Some {pexp_desc = Pexp_tuple sel} when
3560
- constr.cstr_arity > 1 || explicit_arity attrs
3549
+ constr.cstr_arity > 1 || Builtin_attributes. explicit_arity attrs
3561
3550
-> sel
3562
3551
| Some se -> [se] in
3563
3552
if List. length sargs <> constr.cstr_arity then
0 commit comments