我有两个相互依赖的记录,它们都有一个同名的字段。如何使用ocaml.warning
属性隐藏此警告?我想避免像[@@@ocaml.warning "-30"] my types here [@@@ocaml.warning "+30"]
这样的东西。
# type a = {a : int;} and b = { a:int;};;
Characters 30-36:
Warning 30: the label a is defined in both types a and b.
type a = { a : int; }
and b = { a : int; }
这可能没有你想要避免的包围结构更好,但它对我有用:
# module M = struct
type a = {a: int} and b = {a: int}
end [@warning "-30"];;
module M : sig type a = { a : int; } and b = { a : int; } end
# type a = M.a and b = M.b;;
type a = M.a
and b = M.b