Skip to content

Commit 09eaef5

Browse files
cristianoczth
authored andcommitted
Avoid mis-firing when a field is legit missing.
1 parent 8ba7928 commit 09eaef5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jscomp/ml/typecore.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,9 @@ end) = struct
805805
Env.mark_type_used env (Path.last tpath) (Env.find_type tpath env);
806806
match lid.txt with
807807
Longident.Lident s_ -> begin
808-
let s = if List.exists (fun nd -> get_name nd = s_) descrs
808+
let s =
809+
if List.exists (fun nd -> get_name nd = s_) descrs
810+
|| not (List.exists (fun nd -> get_name nd = "anyOtherField") descrs)
809811
then s_
810812
else "anyOtherField" in
811813
try

0 commit comments

Comments
 (0)