Skip to content

Commit

Permalink
Fix unecessary break due to comment in polymorphic variants
Browse files Browse the repository at this point in the history
The previous formatting was:

    | (* Other inline element markup. *)
      `Simple_reference of
      string
  • Loading branch information
Julow committed Oct 31, 2024
1 parent 50946dc commit 1fe7072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Fmt_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
6 changes: 6 additions & 0 deletions test/passing/tests/variants.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]

0 comments on commit 1fe7072

Please sign in to comment.