diff options
| author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-02-19 03:12:36 +0000 |
|---|---|---|
| committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-02-19 03:12:36 +0000 |
| commit | 1f5882e53d452f3ec00d2278f8bd970c15ce6b23 (patch) | |
| tree | 3abc419605865b356fd36b5714a80ab82b4db5b4 /typing | |
| parent | c76b791ca4b77a4d2c14b46d30fc99b4a8b3e45c (diff) | |
| download | ocaml-1f5882e53d452f3ec00d2278f8bd970c15ce6b23.tar.gz | |
Replace error by warning for PR#5835
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13298 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
| -rw-r--r-- | typing/typeclass.ml | 5 | ||||
| -rw-r--r-- | typing/typecore.ml | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/typing/typeclass.ml b/typing/typeclass.ml index fee65fad66..b81f8de1fa 100644 --- a/typing/typeclass.ml +++ b/typing/typeclass.ml @@ -958,8 +958,11 @@ and class_expr cl_num val_env met_env scl = Btype.extract_label name more_sargs in (l', sarg0, sargs @ sargs1, sargs2) in + if optional = Required && Btype.is_optional l' then + Location.prerr_warning sarg0.pexp_loc + (Warnings.Nonoptional_label l); sargs, more_sargs, - if Btype.is_optional l' || not (Btype.is_optional l) then + if optional = Required || Btype.is_optional l' then Some (type_argument val_env sarg0 ty ty) else let ty0 = extract_option_type val_env ty in diff --git a/typing/typecore.ml b/typing/typecore.ml index f13e715852..6ff79925e0 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -2952,10 +2952,11 @@ and type_application env funct sargs = (Warnings.Not_principal "commuting this argument"); (l', sarg0, sargs @ sargs1, sargs2) in - sargs, more_sargs, if optional = Required && is_optional l' then - raise(Error(sarg0.pexp_loc, env, Apply_wrong_label(l', ty_fun'))) - else if optional = Required || is_optional l' then + Location.prerr_warning sarg0.pexp_loc + (Warnings.Nonoptional_label l); + sargs, more_sargs, + if optional = Required || is_optional l' then Some (fun () -> type_argument env sarg0 ty ty0) else begin may_warn sarg0.pexp_loc |
