New warning `not all labels are mentioned in this record pattern'

moved to letter 'R' (instead of 'E' previously).  Explicitly turned 
off in myocamlbuild configuration.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9391 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2009-10-22 15:45:54 +00:00
parent ada68db994
commit 349467ec45
11 changed files with 21 additions and 20 deletions

13
Changes
View File

@ -8,14 +8,15 @@ Language features:
{ lbl } stands for { lbl = lbl } and { M.lbl } for { M.lbl = lbl }
- Record patterns of the form { lbl = pat; _ } to mark that not all
labels are listed, purposefully. (See new warning below.)
- Explicit naming of a generic type; in an expression like "fun ... (type t) ... -> e",
the type t is considered abstract in its scope (the arguments that follow it and the body
of the function), and then replaced by a fresh type variable. In particular, the type t
can be used in contexts where a type variable is not allowed (e.g. for defining
an exception in a local module).
- Explicit naming of a generic type; in an expression
"fun ... (type t) ... -> e", the type t is considered abstract in its
scope (the arguments that follow it and the body of the function),
and then replaced by a fresh type variable. In particular, the type
t can be used in contexts where a type variable is not allowed
(e.g. for defining an exception in a local module).
Compilers and toplevel:
- New warning (activated by 'E', the fragile match warning) to signal
- New warning (activated by the warning code 'R') to signal
record patterns without "; _" where some labels of the record type
are not listed in the pattern.
- Better error report in case of unbound qualified identifier: if the module

12
_tags
View File

@ -19,7 +19,7 @@ true: use_stdlib
# The stdlib neither requires the stdlib nor debug information
<stdlib/**>: -use_stdlib, -debug
<**/*.ml*>: warn_Alez
<**/*.ml*>: warn_Alerz
"toplevel/topstart.byte": linkall
@ -28,18 +28,18 @@ true: use_stdlib
<ocamldoc/*.ml*>: include_unix, include_str, include_dynlink
<ocamldoc/odoc.{byte,native}>: use_unix, use_str, use_dynlink
<camlp4/**/*.ml*>: camlp4boot, -warn_Alez, warn_Ale
<camlp4/**/*.ml*>: camlp4boot, -warn_Alerz, warn_Aler
<camlp4/Camlp4_{config,import}.ml*>: -camlp4boot
"camlp4/Camlp4_import.ml": -warn_Ale
<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Ale, warn_a
"camlp4/Camlp4_import.ml": -warn_Aler
<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Aler, warn_a
<camlp4/Camlp4Bin.{byte,native}> or <camlp4/{mkcamlp4,boot/camlp4boot}.byte>: use_dynlink
"camlp4/Camlp4/Printers/OCaml.ml" or "camlp4/Camlp4/Printers/OCamlr.ml": warn_Alezv
"camlp4/Camlp4/Printers/OCaml.ml" or "camlp4/Camlp4/Printers/OCamlr.ml": warn_Alerzv
<camlp4/Camlp4Printers/**.ml>: include_unix
"camlp4/Camlp4/Struct/DynLoader.ml" or "camlp4/boot/Camlp4.ml": include_dynlink
<camlp4/Camlp4Top/**>: include_toplevel
<camlp4/camlp4{,boot,o,r,of,rf,oof,orf}.byte>: -debug
<ocamlbuild/*>: -warn_Alez, include_unix
<ocamlbuild/*>: -warn_Alerz, include_unix
<**/pervasives.ml> or <**/pervasives.mli> or <**/camlinternalOO.mli>: nopervasives
<**/camlinternalOO*.cmx>: inline(0)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -89,7 +89,7 @@ let windows = Sys.os_type = "Win32"
let may_define_unix = if windows then [] else ["-D UNIX"]
let () =
!options.ocaml_Flags ^= "-w Ale -warn-error Ale"^^
!options.ocaml_Flags ^= "-w Aler -warn-error Aler"^^
(if getenv "DTYPES" "" <> "" then "-dtypes"
else "");
!options.ocaml_P4 := camlp4boot_may_debug may_define_unix;

View File

@ -199,8 +199,8 @@ let cold_camlp4boot = "camlp4boot" (* The installed version *);;
flag ["ocaml"; "ocamlyacc"] (A"-v");;
flag ["ocaml"; "compile"; "warn_Ale"] (S[A"-w";A"Ale"; A"-warn-error";A"Ale"]);;
flag ["ocaml"; "compile"; "warn_Alezv"] (S[A"-w";A"Alezv"; A"-warn-error";A"Alezv"]);;
flag ["ocaml"; "compile"; "warn_Aler"] (S[A"-w";A"Aler"; A"-warn-error";A"Aler"]);;
flag ["ocaml"; "compile"; "warn_Alerzv"] (S[A"-w";A"Alerzv"; A"-warn-error";A"Alerzv"]);;
non_dependency "otherlibs/threads/pervasives.ml" "Unix";;
non_dependency "otherlibs/threads/pervasives.ml" "String";;

View File

@ -432,7 +432,7 @@ let ocaml_warn_flag c =
flag ["ocaml"; "compile"; sprintf "warn_error_%c" (Char.lowercase c)]
(S[A"-warn-error"; A (sprintf "%c" (Char.lowercase c))]);;
List.iter ocaml_warn_flag ['A'; 'C'; 'D'; 'E'; 'F'; 'L'; 'M'; 'P'; 'S'; 'U'; 'V'; 'Y'; 'Z'; 'X'];;
List.iter ocaml_warn_flag ['A'; 'C'; 'D'; 'E'; 'F'; 'L'; 'M'; 'P'; 'R'; 'S'; 'U'; 'V'; 'Y'; 'Z'; 'X'];;
flag ["ocaml"; "doc"; "docdir"; "extension:html"] (A"-html");;
flag ["ocaml"; "doc"; "docdir"; "manpage"] (A"-man");;

View File

@ -19,11 +19,11 @@ type t = (* A is all *)
| Comment_not_end
| Deprecated (* D *)
| Fragile_match of string (* E *)
| Non_closed_record_pattern of string
| Partial_application (* F *)
| Labels_omitted (* L *)
| Method_override of string list (* M *)
| Partial_match of string (* P *)
| Non_closed_record_pattern of string (* R *)
| Statement_type (* S *)
| Unused_match (* U *)
| Unused_pat
@ -49,11 +49,11 @@ let letter = function (* 'a' is all *)
| Comment_not_end -> 'c'
| Deprecated -> 'd'
| Fragile_match _ -> 'e'
| Non_closed_record_pattern _ -> 'e'
| Partial_application -> 'f'
| Labels_omitted -> 'l'
| Method_override _ -> 'm'
| Partial_match _ -> 'p'
| Non_closed_record_pattern _ -> 'r'
| Statement_type -> 's'
| Unused_match
| Unused_pat -> 'u'
@ -108,7 +108,7 @@ let parse_options iserr s =
done
;;
let () = parse_options false "elz";;
let () = parse_options false "elrz";;
let message = function
| Partial_match "" -> "this pattern-matching is not exhaustive."

View File

@ -19,11 +19,11 @@ type t = (* A is all *)
| Comment_not_end
| Deprecated (* D *)
| Fragile_match of string (* E *)
| Non_closed_record_pattern of string
| Partial_application (* F *)
| Labels_omitted (* L *)
| Method_override of string list (* M *)
| Partial_match of string (* P *)
| Non_closed_record_pattern of string (* R *)
| Statement_type (* S *)
| Unused_match (* U *)
| Unused_pat