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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id BA8A1BBC1 for ; Wed, 20 Feb 2008 05:50:08 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEdAu0fAXQImh2dsb2JhbACQUgEBAQgKKZ8S X-IronPort-AV: E=Sophos;i="4.25,379,1199660400"; d="scan'208";a="22813424" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 20 Feb 2008 05:50:08 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1K4o7Mw021383 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 20 Feb 2008 05:50:08 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAApAu0eFBoIFh2dsb2JhbACQUgEBAQgKKZ8Q X-IronPort-AV: E=Sophos;i="4.25,379,1199660400"; d="scan'208";a="7487845" Received: from rabbit.math.nagoya-u.ac.jp ([133.6.130.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 20 Feb 2008 05:50:06 +0100 Received: from localhost (millas [172.16.30.29]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id m1K4o2YJ003013; Wed, 20 Feb 2008 13:50:02 +0900 (JST) Date: Wed, 20 Feb 2008 13:50:02 +0900 (JST) Message-Id: <20080220.135002.71088204.garrigue@math.nagoya-u.ac.jp> To: christophe.raffalli@univ-savoie.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] polymorphic variants and promotion From: Jacques Garrigue In-Reply-To: <47BB5791.4020606@univ-savoie.fr> References: <20080219.223759.125111280.keiko@kurims.kyoto-u.ac.jp> <47BB5791.4020606@univ-savoie.fr> X-Mailer: Mew version 4.0.69 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Miltered: at discorde with ID 47BBB17F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 bug:01 annotations:01 ocaml:01 polymorphic:01 caml-list:01 coercion:01 int:01 int:01 garrigue:03 From: Christophe Raffalli > Keiko Nakata a =E9crit : > > indeed we need to use double coercion, instead of single: > > > > # ((`A 1 : [ `A of int ]) : [ `A of int ] :> [> `A of int ]);; > > - : [> `A of int ] =3D `A 1 > > # ((`A 1 : [ `A of int ]) :> [> `A of int ]);; > > - : [ `A of int ] =3D `A 1 > > > > = > To me this looks like a bug ? Should not we always have that "e :> t"= = > has type "t" (if it typechecks) ? No, it should have type "an instance of t", like for all type annotations in ocaml. And [`A of int] happens to be an instance of [> `A of int]. Jacques Garrigue