diff options
author | Alain Frisch <alain@frisch.fr> | 2012-04-18 09:01:17 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2012-04-18 09:01:17 +0000 |
commit | 9f46d7222a00765c5826c97b09fac7d77d2f853a (patch) | |
tree | 0f44741ddda55ee0523e7b8076830269e86c89bb /utils/warnings.ml | |
parent | 905143bfa21672fef20e55ebe7a8233cd26881c5 (diff) |
Improve message for Unused constructor/exception warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12371 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'utils/warnings.ml')
-rw-r--r-- | utils/warnings.ml | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/utils/warnings.ml b/utils/warnings.ml index 4745598b0..0a950923d 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -56,8 +56,8 @@ type t = | Unused_type_declaration of string (* 34 *) | Unused_for_index of string (* 35 *) | Unused_ancestor of string (* 36 *) - | Unused_constructor of string (* 37 *) - | Unused_exception of string (* 38 *) + | Unused_constructor of string * bool * bool (* 37 *) + | Unused_exception of string * bool (* 38 *) ;; (* If you remove a warning, leave a hole in the numbering. NEVER change @@ -285,8 +285,21 @@ let message = function | Unused_type_declaration s -> "unused type " ^ s ^ "." | Unused_for_index s -> "unused for-loop index " ^ s ^ "." | Unused_ancestor s -> "unused ancestor variable " ^ s ^ "." - | Unused_constructor s -> "unused constructor " ^ s ^ "." - | Unused_exception s -> "unused exception constructor " ^ s ^ "." + | Unused_constructor (s, false, false) -> "unused constructor " ^ s ^ "." + | Unused_constructor (s, true, _) -> + "constructor " ^ s ^ + " is never used to build values.\n\ + (However, this constructor appears in patterns.)" + | Unused_constructor (s, false, true) -> + "constructor " ^ s ^ + " is never used to build values.\n\ + Its type is exported as a private type." + | Unused_exception (s, false) -> + "unused exception constructor " ^ s ^ "." + | Unused_exception (s, true) -> + "exception constructor " ^ s ^ + " is never raised or used to build values.\n\ + (However, this constructor appears in patterns.)" ;; let nerrors = ref 0;; |