diff --git a/src/attribute.ml b/src/attribute.ml index f13e07cda..4de54a7cc 100644 --- a/src/attribute.ml +++ b/src/attribute.ml @@ -307,8 +307,9 @@ let declare_flag name context = module Attribute_table = Stdlib.Hashtbl.Make (struct type t = string loc - let hash : t -> int = Hashtbl.hash - let equal : t -> t -> bool = Poly.equal + let normalize t = { t with loc = { t.loc with loc_ghost = true } } + let hash t = Hashtbl.hash (normalize t) + let equal x y = Poly.equal (normalize x) (normalize y) end) let not_seen = Attribute_table.create 128 diff --git a/test/driver/attributes/test.ml b/test/driver/attributes/test.ml index d526e75cb..a21605e29 100644 --- a/test/driver/attributes/test.ml +++ b/test/driver/attributes/test.ml @@ -260,6 +260,5 @@ let () = let e = [%flag_ghost "bye" [@flag]] [%%expect{| -Line _, characters 29-33: -Error: Attribute `flag' was silently dropped +val e : string * string = ("bye", "bye") |}]