From 7c5691af0f9de17b054ef9e1083cc68463a40f52 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 20 Oct 2023 15:48:24 -0700 Subject: [PATCH] fix(ppx): mark `@@@mel.config` used in interface files too --- ppx/melange_ppx.ml | 8 ++++++++ test/blackbox-tests/unused-attributes.t | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ppx/melange_ppx.ml b/ppx/melange_ppx.ml index be56f14520..cc24d443da 100644 --- a/ppx/melange_ppx.ml +++ b/ppx/melange_ppx.ml @@ -848,6 +848,14 @@ module Mapper = struct :: pval_attributes; }; }) + | Psig_attribute + ({ + (* TODO: remove support for bs.* *) + attr_name = { txt = "bs.config" | "mel.config" | "config"; _ }; + _; + } as attr) -> + Bs_ast_invariant.mark_used_bs_attribute attr; + sigi | _ -> super#signature_item sigi end end diff --git a/test/blackbox-tests/unused-attributes.t b/test/blackbox-tests/unused-attributes.t index d2abc4d41f..1c7346ff3e 100644 --- a/test/blackbox-tests/unused-attributes.t +++ b/test/blackbox-tests/unused-attributes.t @@ -23,10 +23,3 @@ > [@@@mel.config { flags = [|"-unboxed-types"|] }] > EOF $ melc -ppx melppx x.mli - File "x.mli", line 1, characters 6-16: - 1 | [@@@mel.config { flags = [|"-unboxed-types"|] }] - ^^^^^^^^^^ - Alert unused: Unused attribute [@mel.config] - This means such annotation is not annotated properly. - For example, some annotations are only meaningful in externals -