Skip to content

Commit 2c67459

Browse files
committed
Cleanup: keep is always true.
1 parent b9c7ef2 commit 2c67459

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

jscomp/ml/typecore.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ module Label = NameChoice (struct
845845
let unbound_name_error = Typetexp.unbound_label_error
846846
end)
847847

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 *)
850850
let lbls = Hashtbl.create 8 in
851851
Array.iter (fun lbl -> Hashtbl.add lbls lbl.lbl_name ()) lbl.lbl_all;
852852
List.for_all (Hashtbl.mem lbls) ids in
@@ -860,9 +860,9 @@ let disambiguate_label_by_ids keep closed ids labels =
860860
(not closed || mandatory_labels_are_present (List.length ids) lbl)
861861
in
862862
let labels' = Ext_list.filter labels check_ids in
863-
if keep && labels' = [] then (false, labels) else
863+
if labels' = [] then (false, labels) else
864864
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'')
866866

867867
(* Only issue warnings once per record constructor/pattern *)
868868
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 =
891891
Typetexp.unbound_label_error env lid;
892892
let (ok, labels) =
893893
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
896896
in
897897
if ok then Label.disambiguate lid env opath labels ~warn ~scope
898898
else fst (List.hd labels) (* will fail later *)

0 commit comments

Comments
 (0)