Skip to content

Commit

Permalink
Fix unstable unattached doc comment in records (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow authored Aug 30, 2019
1 parent b9b6f32 commit 33f03b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Fmt_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3121,8 +3121,8 @@ and fmt_label_declaration c ctx decl ?(last = false) =
$ fmt_semicolon )
$ cmt_after_type )
$ fmt_attributes c ~pre:(fmt "@;<1 1>") ~key:"@" atrs )
$ Cmts.fmt_after c pld_loc
$ fmt_docstring_padded c doc ) )
$ fmt_docstring_padded c doc
$ Cmts.fmt_after c pld_loc ) )

and fmt_constructor_declaration c ctx ~max_len_name ~first ~last:_ cstr_decl
=
Expand Down
5 changes: 5 additions & 0 deletions test/passing/comments.ml
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,8 @@ let _ =
| Some z -> incr z (* double some *))
| None -> ()
;;

type prefix = {
sib_extend : int; (* extended sib index bit *)
(** add more as needed *)
}
3 changes: 3 additions & 0 deletions test/passing/comments.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,6 @@ let _ =
| Some y -> (
match y with None -> () | Some z -> incr z (* double some *) )
| None -> ()

type prefix =
{sib_extend: int (** add more as needed *) (* extended sib index bit *)}

0 comments on commit 33f03b1

Please sign in to comment.