diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2015-05-24 07:33:32 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2015-05-24 07:33:32 +0000 |
commit | e9785253b2bc630596b4016655f7e7fac2f4aaf8 (patch) | |
tree | c843139671dc7c69b49e59ca1c55be1ef11d4668 /utils/warnings.ml | |
parent | 1585a95502eb29d769a54d5c1065ab5d5c17ce00 (diff) | |
download | ocaml-e9785253b2bc630596b4016655f7e7fac2f4aaf8.tar.gz |
PR#6876: improve warning 6 by listing the omitted labels.
(Eyyüb Sari)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'utils/warnings.ml')
-rw-r--r-- | utils/warnings.ml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/warnings.ml b/utils/warnings.ml index 154f0e6563..8e67881e4c 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -23,7 +23,7 @@ type t = | Deprecated of string (* 3 *) | Fragile_match of string (* 4 *) | Partial_application (* 5 *) - | Labels_omitted (* 6 *) + | Labels_omitted of string list (* 6 *) | Method_override of string list (* 7 *) | Partial_match of string (* 8 *) | Non_closed_record_pattern of string (* 9 *) @@ -82,7 +82,7 @@ let number = function | Deprecated _ -> 3 | Fragile_match _ -> 4 | Partial_application -> 5 - | Labels_omitted -> 6 + | Labels_omitted _ -> 6 | Method_override _ -> 7 | Partial_match _ -> 8 | Non_closed_record_pattern _ -> 9 @@ -260,8 +260,12 @@ let message = function | Partial_application -> "this function application is partial,\n\ maybe some arguments are missing." - | Labels_omitted -> - "labels were omitted in the application of this function." + | Labels_omitted [] -> assert false + | Labels_omitted [l] -> + "label " ^ l ^ " was omitted in the application of this function." + | Labels_omitted ls -> + "labels " ^ String.concat ", " ls ^ + " were omitted in the application of this function." | Method_override [lab] -> "the method " ^ lab ^ " is overridden." | Method_override (cname :: slist) -> |