Better error message for fragile patterns.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Pierre Weis 2003-05-02 12:52:11 +00:00
parent 5a1e71cb2a
commit f2709a7576
3 changed files with 8 additions and 6 deletions

View File

@ -150,7 +150,8 @@ let main () =
\032 U/u enable/disable unused match case\n\
\032 V/v enable/disable hidden instance variables\n\
\032 X/x enable/disable all other warnings\n\
\032 default setting is \"Al\" (all warnings but labels enabled)";
\032 default setting is \"Ale\"\n\
\032 (all warnings but labels and fragile match enabled)";
"-warn-error" , Arg.String (Warnings.parse_options true),
"<flags> Treat the warnings enabled by <flags> as errors.\n\
\032 See option -w for the list of flags.\n\

View File

@ -61,7 +61,8 @@ let main () =
\032 U/u enable/disable unused match case\n\
\032 V/v enable/disable hidden instance variable\n\
\032 X/x enable/disable all other warnings\n\
\032 default setting is \"Al\" (all warnings but labels enabled)";
\032 default setting is \"Ale\"\n\
\032 (all warnings but labels and fragile match enabled)";
"-warn-error" , Arg.String (Warnings.parse_options true),
"<flags> Enable or disable fatal warnings according to <flags>\n\
\032 (see option -w for the list of flags)\n\

View File

@ -91,11 +91,11 @@ let message = function
| Unused_match -> "this match case is unused."
| Unused_pat -> "this pattern is unused."
| Fragile_pat "" ->
"this pattern is fragile: it would not cause a warning \n\
in case of modification of the data types it matches."
"this pattern is fragile. It would hide\n\
the addition of new constructors to the data types it matches."
| Fragile_pat s ->
"this pattern is fragile: it would not cause a warning \n\
in case of modification of the data types it matches.\n\
"this pattern is fragile. It would hide\n\
the addition of new constructors to the data types it matches.\n\
Here is an example of a more robust pattern:\n" ^ s
| Labels_omitted ->
"labels were omitted in the application of this function."