Normalise shared field prefixes at underscore boundaries

This commit is contained in:
milner committed 2019-03-20 13:30:08 +00:00
1 parent d4328bac3f
commit 8f45e6669e
2 files changed
+35 -3

No files matched your search

+17
View File
@@ -52,3 +52,20 @@ let () =
assert (view focus changed = 8 && Swatch.label changed = "grey");
assert (set focus (view focus original) original = original);
assert (set Box._contents "grey" Box.{ contents = 9 } = Box.{ contents = "grey" })
module Prefixed = struct
type t = { paint_colour_red : int; paint_colour_green : int } [@@fieldglass generate]
end
module Unprefixed = struct
type t = { yes : bool; yellow : bool } [@@fieldglass generate]
end
module Single = struct
type t = { paint_red : int } [@@fieldglass generate]
end
let () =
assert (Prefixed.red Prefixed.{ paint_colour_red = 3; paint_colour_green = 4 } = 3);
assert (Unprefixed.yes Unprefixed.{ yes = true; yellow = false });
assert (Single.paint_red Single.{ paint_red = 3 } = 3)