diff --git a/lib/Fmt_ast.ml b/lib/Fmt_ast.ml index e74a8b3dfc..9b6cf4c550 100644 --- a/lib/Fmt_ast.ml +++ b/lib/Fmt_ast.ml @@ -1064,7 +1064,7 @@ and fmt_row_field c ctx {prf_desc; prf_attributes; prf_loc} = | Rinherit typ -> fmt_core_type c (sub_typ ~ctx typ) in hvbox 0 - ( hvbox (Params.Indent.variant_type_arg c.conf) (Cmts.fmt c prf_loc row) + ( Cmts.fmt c prf_loc (hvbox (Params.Indent.variant_type_arg c.conf) row) $ fmt_attributes_and_docstrings c prf_attributes ) and fmt_pattern_attributes c xpat k = diff --git a/test/passing/tests/variants.ml b/test/passing/tests/variants.ml index ad7f37fbd7..982aec9fe7 100644 --- a/test/passing/tests/variants.ml +++ b/test/passing/tests/variants.ml @@ -14,3 +14,9 @@ let _ = (* xx *) `(* yy *) A (* zz *) let _ = (* xx *) `B (* zz *) let _ = `(* yy *) C (* zz *) + +type t = + [ `Fooooo + | (* Other inline element markup. *) + `Simple_reference of string + | `Fooooo ]