fix PR3999/4082
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7563 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
26f488966a
commit
7278d4c343
|
@ -929,16 +929,18 @@ let rec type_exp env sexp =
|
|||
end_def ();
|
||||
generalize_structure funct.exp_type
|
||||
end;
|
||||
let rec lower_args ty_fun =
|
||||
match (expand_head env ty_fun).desc with
|
||||
Tarrow (l, ty, ty_fun, com) ->
|
||||
unify_var env (newvar()) ty;
|
||||
lower_args ty_fun
|
||||
let rec lower_args seen ty_fun =
|
||||
let ty = expand_head env ty_fun in
|
||||
if List.memq ty seen then () else
|
||||
match ty.desc with
|
||||
Tarrow (l, ty_arg, ty_fun, com) ->
|
||||
unify_var env (newvar()) ty_arg;
|
||||
lower_args (ty::seen) ty_fun
|
||||
| _ -> ()
|
||||
in
|
||||
let ty = instance funct.exp_type in
|
||||
end_def ();
|
||||
lower_args ty;
|
||||
lower_args [] ty;
|
||||
begin_def ();
|
||||
let (args, ty_res) = type_application env funct sargs in
|
||||
end_def ();
|
||||
|
|
Loading…
Reference in New Issue