aantron / bisect_ppx

Code coverage for OCaml and ReScript
http://aantron.github.io/bisect_ppx/demo/
MIT License
302 stars 60 forks source link

Unused open warning with exception pattern #350

Closed aantron closed 4 years ago

aantron commented 4 years ago
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:

https://github.com/aantron/bisect_ppx/blob/9bdc5dabad4c6d9f3115cf94ca7657058e10109b/src/ppx/instrument.ml#L507-L509