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

Unused open warning with exception pattern #350

Closed
aantron opened this issue Oct 29, 2020 · 0 comments
Closed

Unused open warning with exception pattern #350

aantron opened this issue Oct 29, 2020 · 0 comments
Labels

Comments

@aantron
Copy link
Owner

aantron commented Oct 29, 2020

module M = struct exception E end
let _ =
  match () with
  | () -> ()
  | M.(exception (E | Exit)) -> ()

generates instrumentation that includes the case | M.(Exit), which then triggers

File "test.ml", line 5, characters 2-26:
5 | | M.(exception (E | Exit)) -> (
      ^^^^^^^^^^^^^^^^^^^^^^^^
Error (warning 33): unused open M.

The solution is probably to suppress warning 33 in the suppression list here:

{attr_name = Location.mkloc "ocaml.warning" loc;
attr_payload = PStr [[%stri "-4-8-9-11-26-27-28"]];
attr_loc = loc}

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

No branches or pull requests

1 participant