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 EAA19257; Fri, 21 Dec 2001 04:02:57 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA19990 for ; Fri, 21 Dec 2001 04:02:56 +0100 (MET) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBL32tn15655 for ; Fri, 21 Dec 2001 04:02:55 +0100 (MET) Received: from localhost (patrick@localhost) by fledge.watson.org (8.11.6/8.11.5) with ESMTP id fBL32qj92403 for ; Thu, 20 Dec 2001 22:02:52 -0500 (EST) (envelope-from patrick@watson.org) Date: Thu, 20 Dec 2001 22:02:52 -0500 (EST) From: Patrick M Doane To: caml-list@inria.fr Subject: [Caml-list] Objects and private methods Message-ID: <20011220215627.C91723-100000@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm having some trouble getting the following type of structure to type-check: class type a = object method get_b : a end and b = object method b : unit end class a_impl = (object (self) method get_b = (self :> b) method private b = () end : a) ;; This produces the error message: The class type object method b : unit method get_b : b end is not matched by the class type a The public method b cannot be hidden The basic idea is that the class 'a_impl' implements 'b' privately. This seems like something that should be possible to do. I suspect that the coercion of self to 'b' is causing the problem here. I would have expected the failure to occur when coercing to type 'b' as the method is declared private (which does not match the signature). Any thoughts? Thanks, Patrick ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr