diff options
author | Alain Frisch <alain@frisch.fr> | 2006-09-09 21:32:56 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2006-09-09 21:32:56 +0000 |
commit | 66bc17247955f4643b5250306c1838b935d40aca (patch) | |
tree | 9657d4f92ee3ac0bf603a44fe20c33b18dacc99d | |
parent | be636db45ba73aeed0ba25bdffe8812bb51f3d03 (diff) | |
download | ocaml-66bc17247955f4643b5250306c1838b935d40aca.tar.gz |
HACK to avoid changing the interface of the Warnings module (necessary to compile ocamldoc because of a dependency in dynlink)
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cducetrunk@7589 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | typing/typeext.ml | 9 | ||||
-rw-r--r-- | utils/warnings.ml | 3 | ||||
-rw-r--r-- | utils/warnings.mli | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/typing/typeext.ml b/typing/typeext.ml index fea131ac4a..aa0433d3cc 100644 --- a/typing/typeext.ml +++ b/typing/typeext.ml @@ -768,10 +768,15 @@ let ext_branch env loc t p a = Location.prerr_warning loc Warnings.Unused_match; let res = P.filter ta p in - Cduce_types.Ident.IdMap.iteri + (* HACK to avoid changing the interface of the Warnings module. *) + if (Warnings.is_active Warnings.Unused_match) + then Cduce_types.Ident.IdMap.iteri (fun x t -> if (CT.subtype (CT.descr t) SEQ.nil_type) then - Location.prerr_warning loc (Warnings.Match_epsilon (id x))) + Format.eprintf + "%aWarning U: the variable %s can only match the empty sequence@." + Location.print loc (id x); + ) res; res diff --git a/utils/warnings.ml b/utils/warnings.ml index abcae9b49f..850dd80b85 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -26,7 +26,6 @@ type t = (* A is all *) | Statement_type (* S *) | Unused_match (* U *) | Unused_pat - | Match_epsilon of string | Hide_instance_variable of string (* V *) | Illegal_backslash (* X *) | Implicit_public_methods of string list @@ -54,7 +53,6 @@ let letter = function (* 'a' is all *) | Partial_match _ -> 'p' | Statement_type -> 's' | Unused_match - | Match_epsilon _ | Unused_pat -> 'u' | Hide_instance_variable _ -> 'v' | Illegal_backslash @@ -115,7 +113,6 @@ let message = function Here is an example of a value that is not matched:\n" ^ s | Unused_match -> "this match case is unused." | Unused_pat -> "this pattern is unused." - | Match_epsilon s -> "the variable " ^ s ^ " can only match the empty sequence." | Fragile_pat "" -> "this pattern is fragile. It would hide\n\ the addition of new constructors to the data types it matches." diff --git a/utils/warnings.mli b/utils/warnings.mli index 0e467a340d..5f22c91bea 100644 --- a/utils/warnings.mli +++ b/utils/warnings.mli @@ -26,7 +26,6 @@ type t = (* A is all *) | Statement_type (* S *) | Unused_match (* U *) | Unused_pat - | Match_epsilon of string | Hide_instance_variable of string (* V *) | Illegal_backslash (* X *) | Implicit_public_methods of string list |