summaryrefslogtreecommitdiff
path: root/typing
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-02-03 05:58:57 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-02-03 05:58:57 +0000
commiteced476cce80ac4e0682b17278c7374a23eedc5c (patch)
tree86e4b2397ad9b290e6dd3ac12c37a99d8f8889e7 /typing
parentfd944666c2f93a9ad4ee5ec7439647b499e5ee00 (diff)
downloadocaml-eced476cce80ac4e0682b17278c7374a23eedc5c.tar.gz
Fix PR#5498
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12111 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
-rw-r--r--typing/ctype.ml5
-rw-r--r--typing/typeclass.ml4
2 files changed, 7 insertions, 2 deletions
diff --git a/typing/ctype.ml b/typing/ctype.ml
index cbd9ec1440..f5371d3870 100644
--- a/typing/ctype.ml
+++ b/typing/ctype.ml
@@ -2206,7 +2206,10 @@ and unify3 env t1 t1' t2 t2' =
unify_row env row1 row2
| (Tfield(f,kind,_,rem), Tnil) | (Tnil, Tfield(f,kind,_,rem)) ->
begin match field_kind_repr kind with
- Fvar r when f <> dummy_method -> set_kind r Fabsent
+ Fvar r when f <> dummy_method ->
+ set_kind r Fabsent;
+ if d2 = Tnil then unify env rem t2'
+ else unify env (newty2 rem.level Tnil) rem
| _ -> raise (Unify [])
end
| (Tnil, Tnil) ->
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
index 512f7cf8b2..5610c3e94e 100644
--- a/typing/typeclass.ml
+++ b/typing/typeclass.ml
@@ -1402,7 +1402,9 @@ let rec unify_parents env ty cl =
let decl = Env.find_class p env in
let _, body = Ctype.find_cltype_for_path env decl.cty_path in
Ctype.unify env ty (Ctype.instance env body)
- with exn -> assert (exn = Not_found)
+ with
+ Not_found -> ()
+ | exn -> assert false
end
| Tclass_structure st -> unify_parents_struct env ty st
| Tclass_fun (_, _, cl, _)