Skip to content

Commit

Permalink
flambda-backend: Don't warn about misplaced attributes in -i mode (#1163
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mshinwell authored Mar 2, 2023
1 parent feefcaa commit d1be563
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions parsing/builtin_attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ let attr_order a1 a2 =
| n -> n

let warn_unused () =
let keys = List.of_seq (Attribute_table.to_seq_keys unused_attrs) in
let keys = List.sort attr_order keys in
List.iter (fun sloc ->
Location.prerr_warning sloc.loc (Warnings.Misplaced_attribute sloc.txt))
keys
(* When using -i, attributes will not have been translated, so we can't
warn about missing ones. *)
if !Clflags.print_types then ()
else
let keys = List.of_seq (Attribute_table.to_seq_keys unused_attrs) in
let keys = List.sort attr_order keys in
List.iter (fun sloc ->
Location.prerr_warning sloc.loc (Warnings.Misplaced_attribute sloc.txt))
keys

(* These are the attributes that are tracked in the builtin_attrs table for
misplaced attribute warnings. Explicitly excluded is [deprecated_mutable],
Expand Down

0 comments on commit d1be563

Please sign in to comment.