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 JAA20319; Tue, 23 Apr 2002 09:41:25 +0200 (MET DST) 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 JAA20344 for ; Tue, 23 Apr 2002 09:41:24 +0200 (MET DST) Received: from ebene.inrialpes.fr (ebene.inrialpes.fr [194.199.18.70]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3N7fNv13719 for ; Tue, 23 Apr 2002 09:41:23 +0200 (MET DST) Received: from pop-serv.inrialpes.fr (pop-serv.inrialpes.fr [194.199.18.66]) by ebene.inrialpes.fr (8.11.6/8.11.6) with ESMTP id g3N7eaR00715; Tue, 23 Apr 2002 09:40:36 +0200 (MEST) Received: from inrialpes.fr (cime.inrialpes.fr [194.199.23.76]) by pop-serv.inrialpes.fr (8.11.3/8.11.3/ImagV2) with ESMTP id g3N7eaX12871; Tue, 23 Apr 2002 09:40:36 +0200 (MEST) Message-ID: <3CC50FF4.E1B0AA5@inrialpes.fr> Date: Tue, 23 Apr 2002 09:40:36 +0200 From: Frederic Tronel X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: John Max Skaller , caml-list@inria.fr Subject: Re: [Caml-list] Problem with parametric classes References: <3CC3CD45.E6D6E166@inrialpes.fr> <3CC47B27.7080308@ozemail.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Max Skaller wrote: > > Frederic Tronel wrote: > > >Hello, > > > >I'm using Ocaml 3.04 (plus a patch applied to circumvent a > >problem with parametric classes bug id 841). > > > >I'm trying to compile the following piece of code (more > >precisely, this is a significant excerpt of the faulty code). > >which fails with the following error: > > > I commented out the initialiser in specElement and got this error: > > File "tmp.ml", line 30, characters 22-41: > The type of this expression, > < get_ident : int; set_ident : int -> unit; _.. > countingObjects, > contains type variables that cannot be generalized > > and here on line 30 you are making an instance object without > binding the type variable .. > > let countingObjects = new countingObjects ;; > > That seems suspicious .. countingObjects is generic > here .. this is at global scope .. the initialiser > which fixes the type is inside a class .. > this has to be wrong .. Why not ? This code has worked for a long time, before I decided to add some features (synchroAccounting class). Frederic. ------------------- 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