From c5bbe9955115f964e4653199a13c293423f5e44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Mon, 10 Jun 1996 11:26:54 +0000 Subject: [PATCH] Correction d'un bug (occur check qui bouclait parfois). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@867 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- typing/ctype.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typing/ctype.ml b/typing/ctype.ml index 94d185eed..da6fc7cf1 100644 --- a/typing/ctype.ml +++ b/typing/ctype.ml @@ -403,11 +403,12 @@ let generic_abbrev env path = let occur env ty0 ty = let visited = ref ([] : type_expr list) in let rec occur_rec ty = + let ty = repr ty in + if ty == ty0 then raise (Unify []); match ty.desc with Tlink ty' -> occur_rec ty' | Tvar -> - if ty == ty0 then raise (Unify []) else () | Tarrow(t1, t2) -> occur_rec t1; occur_rec t2 @@ -497,7 +498,7 @@ and unify_core env a1 a2 t1 t2 = (* Other cases *) | (Some l1, None) -> update_level t2.level t1; t2.desc <- Tlink l1 | (_, _) -> - update_level t1.level t2; t1.desc <- Tlink t2 + update_level t1.level t2; occur env t1 t2; t1.desc <- Tlink t2 end; try match (d1, d2) with