File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ unreleased
2+ ----------
3+
4+ * Fix ordering of derived ` make ` 's arguments
5+ #284
6+ (@NathanReb )
7+
186.0.1 (17/04/2024)
29------------------
310
Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ let str_of_record_type ~quoter ~loc labels =
9797 | None ->
9898 record fields
9999 in
100- List. fold_left (add_str_label_arg ~quoter ~loc ) fn labels
100+ (* The labels list must be reversed here so that the arguments are in the
101+ same order as the record fields. *)
102+ List. fold_left (add_str_label_arg ~quoter ~loc ) fn (List. rev labels)
101103
102104let str_of_type ({ ptype_loc = loc } as type_decl ) =
103105 let quoter = Ppx_deriving. create_quoter () in
@@ -156,7 +158,9 @@ let sig_of_record_type ~loc ~typ labels =
156158 | None when has_option -> Typ. arrow Label. nolabel (tconstr " unit" [] ) typ
157159 | None -> typ
158160 in
159- List. fold_left add_sig_label_arg typ labels
161+ (* The labels list must be reversed here so that the arguments are in the
162+ same order as the record fields. *)
163+ List. fold_left add_sig_label_arg typ (List. rev labels)
160164
161165let sig_of_type ({ ptype_loc = loc } as type_decl ) =
162166 let typ = Ppx_deriving. core_type_of_type_decl type_decl in
You can’t perform that action at this time.
0 commit comments