I wonder if it is possible to make the OCaml compiler to report unused module aliases?
For example, in the following file (
test.ml), I want to enable
ocamlc to report the warnings that two module aliases
L are unused.
module S = String module L = List let foo () = let a = 1 in let b = 2 in a + b ;;
The only relevant warning options that I can find from
ocamlc -warn-help are
31 (31 [module-linked-twice] A module is linked twice in the same executable) and
60 ([unused-module] Unused module declaration).
However, when running the following command,
ocamlc doesn’t report any warning.
$ ocamlc -w +31+60+66 test.ml # no warning is reported
Does anyone know how to enable
ocamlc to report such warnings that
module S = String and
module L = List are unused?
Thank you for spending your time to read my question!