From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA25051; Fri, 6 Sep 2002 06:16:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA25044 for ; Fri, 6 Sep 2002 06:16:10 +0200 (MET DST) Received: from corwin.mutu.net (mutu.net [80.65.226.162]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g864G9911770 for ; Fri, 6 Sep 2002 06:16:09 +0200 (MET DST) Received: by corwin.mutu.net (Postfix, from userid 1000) id 62753159025; Fri, 6 Sep 2002 06:16:08 +0200 (CEST) To: caml-list@inria.fr Subject: [Caml-list] strange typing errors X-face: '|!UPdE>Ot'L}nt?6Tf|'s{y%l~,+Yc5|p8A}ibew|_!vc48pPNPPx@7QA~$`$g=|yH*8sh9R]Xj1(CV7oUe>#/,t.(Z4F From: Dimitri Ara Date: 06 Sep 2002 06:16:08 +0200 Message-ID: <874rd3wy5z.fsf@corwin.mutu.net> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, While ICFPing, I came upon some strange typing error messages. The first one is : class type ct = object method m : l:int -> ct end let rec f (o : ct) = let rec g o = let x = o#m 1 in g x in g o which is well typed accorded to caml if I remove the l label. Here is the error I got: This expression has type ct = < m : l:int -> ct > as 'a but is here used with type 'a The second one is ill-typed and get the same error message: class type ct = object method m : l:int -> int end let rec f (o : ct) = let rec g o = let x = o#m 1 in g x in g o If I remove the label I got a stranger error: This expression has type ct = < m : int -> int > as 'a but is here used with type 'a Type int is not compatible with type ct = 'a Can someone explain that? -- Dimitri Ara ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners