check partly defined types

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5461 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2003-03-26 08:24:02 +00:00
parent d385c34635
commit 5db155fee3
1 changed files with 7 additions and 1 deletions

View File

@ -181,9 +181,15 @@ let rec transl_type env policy rowvar styp =
with Unify trace ->
raise (Error(styp.ptyp_loc, Type_mismatch trace))
end;
let unify_param =
match decl.type_manifest with
None -> unify_var
| Some ty ->
if (repr ty).level = Btype.generic_level then unify_var else unify
in
List.iter2
(fun (sty, ty) ty' ->
try unify_var env ty' ty with Unify trace ->
try unify_param env ty' ty with Unify trace ->
raise (Error(sty.ptyp_loc, Type_mismatch (swap_list trace))))
(List.combine stl args) params;
cstr