summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-09-15 03:09:26 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-09-15 03:09:26 +0000
commitc54747bf82facad52e4df9476b9c6a75c21f3a52 (patch)
tree93041abe8719fd69ad042e3f7d82992cbc78c6e2 /utils
parenta5f0fd6a27c9d87669084ddc9b58cc0893c0dda6 (diff)
downloadocaml-c54747bf82facad52e4df9476b9c6a75c21f3a52.tar.gz
warn about useless with in record
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7051 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'utils')
-rw-r--r--utils/warnings.ml5
-rw-r--r--utils/warnings.mli1
2 files changed, 6 insertions, 0 deletions
diff --git a/utils/warnings.ml b/utils/warnings.ml
index f45d68b97c..3adda4666f 100644
--- a/utils/warnings.ml
+++ b/utils/warnings.ml
@@ -37,6 +37,7 @@ type t = (* A is all *)
| Nonreturning_statement
| Camlp4 of string
| All_clauses_guarded
+ | Useless_record_with
| Unused_var of string (* Y *)
| Unused_var_strict of string (* Z *)
;;
@@ -63,6 +64,7 @@ let letter = function (* 'a' is all *)
| Unused_argument
| Nonreturning_statement
| Camlp4 _
+ | Useless_record_with
| All_clauses_guarded -> 'x'
| Unused_var _ -> 'y'
| Unused_var_strict _ -> 'z'
@@ -149,6 +151,9 @@ let message = function
| Camlp4 s -> s
| All_clauses_guarded ->
"bad style, all clauses in this pattern-matching are guarded."
+ | Useless_record_with ->
+ "this record is defined by a `with' expression,\n\
+ but no fields are borrowed from the original."
;;
let nerrors = ref 0;;
diff --git a/utils/warnings.mli b/utils/warnings.mli
index a623bb2c7a..5f22c91bea 100644
--- a/utils/warnings.mli
+++ b/utils/warnings.mli
@@ -37,6 +37,7 @@ type t = (* A is all *)
| Nonreturning_statement
| Camlp4 of string
| All_clauses_guarded
+ | Useless_record_with
| Unused_var of string (* Y *)
| Unused_var_strict of string (* Z *)
;;