fix PR#1591

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5721 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2003-07-22 10:58:39 +00:00
parent 0ace6f6a76
commit dada132355
1 changed files with 4 additions and 3 deletions

View File

@ -105,20 +105,21 @@ let rec typexp s ty =
ty.desc <- Tsubst ty2; (* avoid Tlink in the new type *)
Tlink ty2
| _ ->
let static = static_row row in
let dup =
s.for_saving || more.level = generic_level || static_row row in
(* Various cases for the row variable *)
let more' =
match more.desc with Tsubst ty -> ty
| _ ->
save_desc more more.desc;
if s.for_saving then newpersty more.desc else
if static then newgenvar () else more
if dup && more.desc <> Tunivar then newgenvar () else more
in
(* Register new type first for recursion *)
more.desc <- Tsubst(newgenty(Ttuple[more';ty']));
(* Return a new copy *)
let row =
copy_row (typexp s) true row (not s.for_saving) more' in
copy_row (typexp s) true row (not dup) more' in
let row =
if s.for_saving then {row with row_bound = []} else row in
match row.row_name with