summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2003-03-26 08:24:02 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2003-03-26 08:24:02 +0000
commit5db155fee3363e3991cb1d0d5bbdd01ccaecd902 (patch)
tree8cc5236ba388ce6eab32fb56e122772bde3550e5
parentd385c34635092b35cfce8b11830569a6befe7e84 (diff)
check partly defined types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5461 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/typetexp.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/typing/typetexp.ml b/typing/typetexp.ml
index 1a8fb0232..17ae0d920 100644
--- a/typing/typetexp.ml
+++ b/typing/typetexp.ml
@@ -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