summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2012-09-10 13:00:01 +0000
committerAlain Frisch <alain@frisch.fr>2012-09-10 13:00:01 +0000
commit9748c4aa16ae37a08e923ec90eb84fb80cc1a2ba (patch)
tree6cb0e462c7f5a491dfdd27f7db2bf60ca79ea29e
parentd228342e8a1472cfbf055e7234cbb8315a29fa52 (diff)
Fix content of .cmt files correponding to the automatic 'discarding' of optional parameters (missing labels + bad order of inserted 'None' arguments).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/typecore.ml6
1 files changed, 2 insertions, 4 deletions
diff --git a/typing/typecore.ml b/typing/typecore.ml
index d0fa63ed6..9f9dcffd3 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -2427,7 +2427,7 @@ and type_argument env sarg ty_expected' ty_expected =
match (expand_head env ty_fun).desc with
| Tarrow (l,ty_arg,ty_fun,_) when is_optional l ->
make_args
- ((Some(option_none (instance env ty_arg) sarg.pexp_loc), Optional)
+ ((l, Some(option_none (instance env ty_arg) sarg.pexp_loc), Optional)
:: args)
ty_fun
| Tarrow (l,_,ty_res',_) when l = "" || !Clflags.classic ->
@@ -2463,9 +2463,7 @@ and type_argument env sarg ty_expected' ty_expected =
{ texp with exp_type = ty_fun; exp_desc =
Texp_function("", [eta_pat, {texp with exp_type = ty_res; exp_desc =
Texp_apply (texp,
- (List.map (fun (label, exp) ->
- ("", label, exp)) args)@
- ["", Some eta_var, Required])}],
+ List.rev args @ ["", Some eta_var, Required])}],
Total) } in
if warn then Location.prerr_warning texp.exp_loc
(Warnings.Without_principality "eliminated optional argument");