diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2001-09-27 07:34:39 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2001-09-27 07:34:39 +0000 |
commit | 4cf25f9e3e5f512bf058a213a4bff7e54afee01c (patch) | |
tree | 6d86b18267d2a25a7a12baa665ea748f7185e873 | |
parent | 4e056bc4d41ba7a1bb75a860eaa3be1c26ccd0ff (diff) |
enleve [ ]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3801 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | typing/ctype.ml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/typing/ctype.ml b/typing/ctype.ml index 28eb6d752..85c6cd9f7 100644 --- a/typing/ctype.ml +++ b/typing/ctype.ml @@ -1321,6 +1321,13 @@ and unify_row env row1 row2 = in let empty fields = List.for_all (fun (_,f) -> row_field_repr f = Rabsent) fields in + if (row1.row_closed || row2.row_closed) + && (empty r1 || row2.row_closed) && (empty r2 || row1.row_closed) + && List.for_all + (fun (_,f1,f2) -> + row_field_repr f1 = Rabsent || row_field_repr f2 = Rabsent) + pairs + then raise (Unify []); let name = if row1.row_name <> None && (row1.row_closed || empty r2) && (not row2.row_closed || keep (fun f1 f2 -> f1, f2) && empty r1) @@ -1348,7 +1355,7 @@ and unify_row env row1 row2 = begin try rm1.desc <- Tlink (more row1 r2); rm2.desc <- Tlink (more row2 r1); - List.iter (fun (l,f1,f2) -> unify_row_field env f1 f2) pairs + List.iter (fun (l,f1,f2) -> unify_row_field env f1 f2) pairs with exn -> rm1.desc <- md1; rm2.desc <- md2; raise exn end |