fix limited_generalize for variants

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6620 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2004-09-21 12:08:12 +00:00
parent 695fe90650
commit 281e9b9867
1 changed files with 7 additions and 1 deletions

View File

@ -678,7 +678,13 @@ let limited_generalize ty0 ty =
let idx = ty.level in
if idx <> generic_level then begin
set_level ty generic_level;
List.iter generalize_parents !(snd (Hashtbl.find graph idx))
List.iter generalize_parents !(snd (Hashtbl.find graph idx));
(* Special case for rows: must generalize the row variable *)
match ty.desc with
Tvariant row ->
let more = row_more row in
if more.level <> generic_level then generalize_parents more
| _ -> ()
end
in