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=2.4 required=5.0 tests=AWL,DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D9D75BBAF for ; Tue, 21 Oct 2008 09:15:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYDAP4c/UjAXQImgWdsb2JhbACTMT4BARYip0F/hy8BAwEDg00 X-IronPort-AV: E=Sophos;i="4.33,456,1220220000"; d="scan'208";a="16306506" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Oct 2008 09:15:26 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m9L7FQGN007624 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 21 Oct 2008 09:15:26 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAJQe/UhIDtybimdsb2JhbACTMT4BAQEKCQwHDwWnPn+HLwEDAQODTQ X-IronPort-AV: E=Sophos;i="4.33,456,1220220000"; d="scan'208";a="18983003" Received: from fg-out-1718.google.com ([72.14.220.155]) by mail1-smtp-roc.national.inria.fr with ESMTP; 21 Oct 2008 09:15:26 +0200 Received: by fg-out-1718.google.com with SMTP id e21so1679165fga.25 for ; Tue, 21 Oct 2008 00:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=iiQ2A7AOYVdSdHUMIYW+Rq75YUT/jjhR2lgGfZbe6tM=; b=kWxMhLcx/Oz5nA5oJua9cZCIkXX8H/wNYTf9wUUu4PQCY3O62mhrQ8HTTxvm7g15jO abeE7I2LBhNPJlAFZvT8ADb2LDVfwEXPkveu5/LdG5oYpq9uNC9Sb/iLwIRUsUtiNhW7 m9MowY0VzJ/FiF9qb0YrV0ugr0CCQ5iOVF3Gk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=ONFhGBbJgddd8jtDTJjQo3RJRohuD/tgzt6rxmRDrv1LjtHKJsFAbmd0GRhsBrGqEw KMtod/aEXYX5UNzNz/E6e6dvtcDNIv7/vmIgG/+OozcA29vFUkm1CIV05FsuygfgtNea Amj+HKlUHFdJOA5ZLcEwC8zlLo5M15G5aXwX8= Received: by 10.181.25.10 with SMTP id c10mr1075537bkj.181.1224573325647; Tue, 21 Oct 2008 00:15:25 -0700 (PDT) Received: by 10.180.244.3 with HTTP; Tue, 21 Oct 2008 00:15:25 -0700 (PDT) Message-ID: <5160b4200810210015q720ae14dx8cf4a5fa05ae6e30@mail.gmail.com> Date: Tue, 21 Oct 2008 16:15:25 +0900 From: "Jun Furuse" To: "caml users" Subject: A bug(?) around phantoms in 3.11.0 b1 (Re: [Caml-list] OCaml version 3.11.0+beta1) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Miltered: at discorde with ID 48FD818E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; furuse:01 furuse:01 bug:01 ocaml:01 bug:01 compilable:01 sig:01 val:01 struct:01 sig:01 val:01 struct:01 compile:01 compiles:01 caml-list:01 Hi, I found a strange bug in 3.11.0 beta 1. The following typical example of phantom types does not compile any more. (It is compilable in 3.10.2, but not in release311): module M : sig type +'a t constraint 'a = [< `checked | `unchecked ] val check : _ t -> [ `checked ] t end = struct type +'a t = { x : int } constraint 'a = [< `checked | `unchecked ] let check (t : _ t) = t (* actually it grants anything *) end A strange thing is that if I change the definition as follows it compiles! module M : sig type +'a t constraint 'a = [< `checked | `unchecked ] val check : _ t -> [ `checked ] t end = struct type u = { x : int } (* strange workaround *) type +'a t = u constraint 'a = [< `checked | `unchecked ] let check (t : _ t) = t (* actually it grants anything *) end = j