Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Empty comment block recognized as documentation comment #2558

Open
crackcomm opened this issue Jun 14, 2024 · 1 comment
Open

Bug: Empty comment block recognized as documentation comment #2558

crackcomm opened this issue Jun 14, 2024 · 1 comment

Comments

@crackcomm
Copy link

crackcomm commented Jun 14, 2024

Describe the bug

Empty comment block (**) is recognized as documentation comment and triggers a warning:

58 |   (**)
       ^^^^
Warning 50 [unexpected-docstring]: unattached documentation comment (ignored)
Hint: (Warning 50) This file contains a documentation comment (** ... *) that the OCaml compiler does not know how to attach to the AST. OCamlformat does not support these cases. You can find more information at: https://github.com/ocaml-ppx/ocamlformat#overview. If you'd like to disable this check and let ocamlformat make a choice (though it might not be consistent with the ocaml compilers and odoc), you can set the --no-comment-check option.
@Julow
Copy link
Collaborator

Julow commented Jun 20, 2024

I guess the source looks like this: (the comment is in an expression)

let _ =
  (**)
  ()

Unfortunately, there's nothing we can do as the warning is real. The compiler do not report it by default as comments have no impact on the type checking but it can be seem with ocamlc -w +50.

OCamlformat cares about this warning as this comment is very hard to print again in the right location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants