From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id DAA5BBB91 for ; Sat, 25 Dec 2004 23:58:12 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBPMwC9b018193 for ; Sat, 25 Dec 2004 23:58:12 +0100 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 XAA26905 for ; Sat, 25 Dec 2004 23:58:12 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBPMw9fa013739 for ; Sat, 25 Dec 2004 23:58:11 +0100 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id iBPMw4KE023229; Sun, 26 Dec 2004 07:58:05 +0900 (JST) Date: Sun, 26 Dec 2004 07:57:48 +0900 (JST) Message-Id: <20041226.075748.126851009.garrigue@math.nagoya-u.ac.jp> To: briand@aracnet.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] method name collision ? From: Jacques Garrigue In-Reply-To: <16845.50460.152550.387582@soggy.deldotd.com> References: <16845.50460.152550.387582@soggy.deldotd.com> X-Mailer: Mew version 4.0.64 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 41CDF084.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41CDF081.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 gdraw:01 ...:98 ...:98 inherit:01 defining:01 jacques:01 jacques:01 defined:01 int:01 int:01 unit:02 inheriting:03 seems:03 garrigue:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: From: briand@aracnet.com > I'm getting the following error > > The method point has type 'a -> 'b but is expected to have type > x:int -> y:int -> unit > > for this code : > > method point p0 = > etc.. > > The error makes sense, as in, I know that it is colliding with a > method defined in the drawable class. > > However I am inheriting the class using : > > inherit GDraw.drawable ?colormap w as drawable > > It seems to me that the method I am defining, self#point, and the > method in drawable, i.e. drawable#point, are distinct and therefore > I should not be seeing this error message ? The "as drawable" doesn't mean that the methods are distinct: you can still call all inherited methods from the outside, and even through self. This only allows you to access the old definition of a method, if you want to extend it incrementally. method point ~x ~y = ... drawable#point ~x ~y ... Jacques Garrigue