You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7701 Reporter: antron Assigned to:@lpw25 Status: resolved (set by @gasche on 2018-05-05T14:00:49Z) Resolution: fixed Priority: normal Severity: minor Version: 4.06.0 Fixed in version: 4.07.0+dev/beta2/rc1/rc2 Category: typing Duplicate of:#7138 Monitored by:@gasche
Bug description
When an .mli file consists of only a (** ... *) comment, the comment does not appear in the signature item list of the signature read from the corresponding .cmti file. By contrast, if the signature includes a comment and some other items, the comment appears in the signature item list.
Steps to reproduce
empty.mli:
(** This comment will be lost by the compiler. *)
nonempty.mli:
(** This comment will be kept by the compiler. *)
val foo : unit
count_sig_items.ml:
let () =
let file = Sys.argv.(1) in
let cmt = Cmt_format.read_cmt file in
match cmt.cmt_annots with
| Interface signature ->
signature.Typedtree.sig_items
|> List.length
|> string_of_int
|> print_endline
| _ ->
assert false
Activity
vicuna commentedon Jan 6, 2018
Comment author: @Octachron
A quick workaround for this issue is to add two empty new lines before the documentation comment.
For a more robust fix, see #1562 .
vicuna commentedon May 5, 2018
Comment author: @gasche
After another iteration, a fix was merged from
#1693
which I am currently working on backporting into 4.07.