Skip to content

Bug: regular comments surrounding a doc-comment, ocamlformat cannot process #1092

@chairmanlee8

Description

@chairmanlee8

Describe the bug
This code...

type t =
  { a : int
  (* oops I wrote a long comment before and after which is going to break the doc-comment *)
  (** [a] is an integer and I like it very much *)
  (* oops I wrote a long comment before and after which is going to break the doc-comment *)
  ; b : int
  }

...causes ocamlformat to produce

ocamlformat: Cannot process "ocamlformat_woe.mli".
   Please report this bug at https://github.com/ocaml-ppx/ocamlformat/issues.
   BUG: generating invalid ocaml syntax.

While the original code arguably is wrong in some (which?) sense, I would rather ocamlformat complain about it as a rule rather than erroring out...

How to Reproduce
Run ocamlformat with --profile=janestreet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions