From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AA1A1BC69 for ; Mon, 19 Feb 2007 01:58:19 +0100 (CET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1J0wH2e001776 for ; Mon, 19 Feb 2007 01:58:18 +0100 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id l1J0wFUF023930; Mon, 19 Feb 2007 09:58:16 +0900 (JST) Date: Mon, 19 Feb 2007 09:58:08 +0900 (JST) Message-Id: <20070219.095808.28398298.garrigue@math.nagoya-u.ac.jp> To: carette@mcmaster.ca Cc: caml-list@inria.fr Subject: Re: [Caml-list] Rank-2 polymorphism woes in module signatures From: Jacques Garrigue In-Reply-To: <45D8DEB7.3030004@mcmaster.ca> References: <45D8DEB7.3030004@mcmaster.ca> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45D8F629.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; polymorphism:01 bug:01 ocaml:01 ctype:01 ctype:01 subst:01 unify:01 unify:01 cvs:01 signatures:01 typing:01 typing:01 caml-list:01 csl:01 pairs:01 From: Jacques Carette > 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