Version française
Home     About     Download     Resources     Contact us    
Browse thread
Rank-2 polymorphism woes in module signatures
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] Rank-2 polymorphism woes in module signatures
From: Jacques Carette <carette@mcmaster.ca>

> Those look absolutely identical to me - especially since the definitions 
> were done via copy & paste.
> The rank-1 parts of the same record work fine [not shown], but none of 
> the rank-2 parts do.  The above is a minimal extraction from a real program.
> Can anyone help?  [This is in 3.09.01]

Thanks for finding a (very stupid) bug, triggered by your use of a
phantom type. This is now fixed in CVS for 3.10.
Here is a patch that should work on any version of ocaml.

Jacques Garrigue

Index: typing/ctype.ml
===================================================================
RCS file: /net/yquem/devel/caml/repository/csl/typing/ctype.ml,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -r1.204 -r1.205
--- typing/ctype.ml	16 Feb 2007 11:18:36 -0000	1.204
+++ typing/ctype.ml	19 Feb 2007 00:49:16 -0000	1.205
@@ -2264,7 +2264,7 @@
               enter_poly env univar_pairs t1 tl1 t2 tl2
                 (eqtype rename type_pairs subst env)
           | (Tunivar, Tunivar) ->
-              unify_univar t1 t2 !univar_pairs
+              unify_univar t1' t2' !univar_pairs
           | (_, _) ->
               raise (Unify [])
         end