summaryrefslogtreecommitdiff
path: root/ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml')
-rw-r--r--ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml b/ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml
new file mode 100644
index 0000000000..bed7db7b71
--- /dev/null
+++ b/ocaml-binary-annot/camlp4/test/fixtures/pr4452.ml
@@ -0,0 +1,24 @@
+open Camlp4.PreCast
+
+let _loc = Loc.mk "?"
+
+let base base fields ty =
+ let fields = List.fold_right (fun field acc ->
+ let c = <:ctyp< $lid:field$ : $uid:field$.record >> in
+ <:ctyp< $c$ ; $acc$ >>) fields <:ctyp< >>
+ in
+ <:module_binding< $uid:base$ :
+ sig type record = {
+ key : $ty$;
+ $fields$
+ } end = struct
+ type record = {
+ key : $ty$;
+ $fields$
+ } end
+ >>
+
+let _ =
+ let b = base "b" ["f1"; "f2"] <:ctyp< int >> in
+ Camlp4.PreCast.Printers.OCaml.print_implem
+ <:str_item< module rec $b$ >>