Skip to content

Commit

Permalink
Reproduction for issue #52
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <kakadu@pm.me>
  • Loading branch information
Kakadu committed May 7, 2024
1 parent 3f7fc63 commit 99578a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/typed/ExcTry.t/ExcTryWithWildcard.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@ let foo f =
| [] -> 1
| exception _ -> 2
| _ -> 3

[@@@ocaml.warning "-unused-value-declaration" ]
[@@@ocaml.warning "-unused-var-strict"]
let bar =
try 1 with | e -> 2
(* TODO: this should be reported too
https://github.com/semgrep/semgrep/issues/10193
Issue #52
*)



module FOO(_ : sig end) = struct
let _inside_functor =
try 1 with | _ -> 2
end
4 changes: 4 additions & 0 deletions tests/typed/ExcTry.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
2 | ..try raise Not_found
3 | with _ -> 1
Alert zanuda-linter: Antipattern: error swallowing
File "ExcTryWithWildcard.ml", line 24, characters 4-23:
24 | try 1 with | _ -> 2
^^^^^^^^^^^^^^^^^^^
Alert zanuda-linter: Antipattern: error swallowing

0 comments on commit 99578a4

Please sign in to comment.