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.7 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 49749BC6B for ; Thu, 10 Jan 2008 13:38:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHaghUeZYFcSeGdsb2JhbACQHwEKBAYPGpk2 X-IronPort-AV: E=Sophos;i="4.24,266,1196636400"; d="scan'208";a="7636923" Received: from mailgwb1.fraunhofer.de ([153.96.87.18]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Jan 2008 13:38:48 +0100 Received: from mailgwb1.fraunhofer.de (localhost [127.0.0.1]) by mailgwb1.fraunhofer.de (8.13.5+/8.13.4) with ESMTP id m0ACclqM020515 for ; Thu, 10 Jan 2008 13:38:47 +0100 (CET) Received: from kso.iais.fraunhofer.de (mail-gw.iais.fraunhofer.de [193.175.162.66]) by mailgwb1.fraunhofer.de (8.13.5+/8.13.4) with ESMTP id m0ACcfYj020155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jan 2008 13:38:43 +0100 (CET) Received: from ksi.iais.fraunhofer.de (ksi.iais.fraunhofer.de [129.26.64.2]) by kso.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id m0ACZraB010564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jan 2008 13:35:53 +0100 (CET) X-Received: iais.fraunhofer.de-policy from ksi.iais.fraunhofer.de (localhost [127.0.0.1]) by ksi.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id m0ACZlUX023123 for ; Thu, 10 Jan 2008 13:35:47 +0100 (CET) Received: from macbook-axel.ais.fraunhofer.de (macbook-axel.ais.fraunhofer.de [129.26.149.197]) by ksi.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id m0ACZli7023120 for ; Thu, 10 Jan 2008 13:35:47 +0100 (CET) Message-Id: From: =?ISO-8859-1?Q?Axel_Poign=E9?= To: Caml Mailing List In-Reply-To: <9f09a07a0801100005n5061a656ubbf7620e48e298ee@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Type checking question Date: Thu, 10 Jan 2008 13:35:45 +0100 References: <9f09a07a0801100005n5061a656ubbf7620e48e298ee@mail.gmail.com> X-Mailer: Apple Mail (2.915) X-Fraunhofer-Email-Policy: accepted X-Spam: no; 0.00; fraunhofer:01 val:01 mutable:01 val:01 mutable:01 inherit:01 int:01 int:01 checking:02 unit:03 let:03 object:09 object:09 zzz:10 zzz:10 Hello why does this work #class xxx (x:int) = object(self) val mutable _x = x method get = _x end;; class xxx : int -> object val mutable _x : int method get : int end #class yyy (x:int) = object(self) inherit xxx x method set y = _x <- y end;; class yyy : int -> object val mutable _x : int method get : int method set : int -> unit end #class zzz (x:xxx) = object(self) method get = x#get end;; class zzz : xxx -> object method get : int endlet yy = new yyy 8;; #let zz = new zzz((yy:yyy):>xxx);; val zz : zzz = #zz#get;; - : int = 8 I would expect that yy is of not type yyy = int -> ... Axel