@@ -845,8 +845,8 @@ module Label = NameChoice (struct
845
845
let unbound_name_error = Typetexp. unbound_label_error
846
846
end )
847
847
848
- let disambiguate_label_by_ids keep closed ids labels =
849
- let check_ids (lbl , _ ) =
848
+ let disambiguate_label_by_ids closed ids labels =
849
+ let check_ids (lbl , _ ) = (* check that all ids are present *)
850
850
let lbls = Hashtbl. create 8 in
851
851
Array. iter (fun lbl -> Hashtbl. add lbls lbl.lbl_name () ) lbl.lbl_all;
852
852
List. for_all (Hashtbl. mem lbls) ids in
@@ -860,9 +860,9 @@ let disambiguate_label_by_ids keep closed ids labels =
860
860
(not closed || mandatory_labels_are_present (List. length ids) lbl)
861
861
in
862
862
let labels' = Ext_list. filter labels check_ids in
863
- if keep && labels' = [] then (false , labels) else
863
+ if labels' = [] then (false , labels) else
864
864
let labels'' = Ext_list. filter labels' check_closed in
865
- if keep && labels'' = [] then (false , labels') else (true , labels'')
865
+ if labels'' = [] then (false , labels') else (true , labels'')
866
866
867
867
(* Only issue warnings once per record constructor/pattern *)
868
868
let disambiguate_lid_a_list loc closed env opath lid_a_list =
@@ -891,8 +891,8 @@ let disambiguate_lid_a_list loc closed env opath lid_a_list =
891
891
Typetexp. unbound_label_error env lid;
892
892
let (ok, labels) =
893
893
match opath with
894
- Some ( _ , _ ) -> (true , scope) (* disambiguate only checks scope *)
895
- | _ -> disambiguate_label_by_ids (opath = None ) closed ids scope
894
+ Some _ -> (true , scope) (* disambiguate only checks scope *)
895
+ | _ -> disambiguate_label_by_ids closed ids scope
896
896
in
897
897
if ok then Label. disambiguate lid env opath labels ~warn ~scope
898
898
else fst (List. hd labels) (* will fail later *)
0 commit comments