From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA30226 for caml-redistribution; Fri, 24 Sep 1999 18:05:17 +0200 (MET DST) 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 OAA15695 for ; Fri, 24 Sep 1999 14:05:25 +0200 (MET DST) Received: from malonne.lifl.fr (malonne.lifl.fr [134.206.10.29]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA18671 for ; Fri, 24 Sep 1999 14:05:24 +0200 (MET DST) Received: from gala.lifl.fr (gala.lifl.fr [134.206.10.216]) by malonne.lifl.fr (8.8.8/jtpda-5.3) with ESMTP id OAA16724 ; Fri, 24 Sep 1999 14:06:52 +0200 (MET DST) Received: from (boulet@localhost) by gala.lifl.fr (8.9.3/jtpda-5.2.9.1) id OAA02216 ; Fri, 24 Sep 1999 14:06:45 +0200 To: peter.schrammel@gmx.de Cc: caml-list@inria.fr Subject: Re: Tree of a certain class: References: <199909171244.OAA22193@pauillac.inria.fr> <37EB3338.4E226250@unibw-muenchen.de> From: Pierre Boulet In-Reply-To: Peter Schrammel's message of "Fri, 24 Sep 1999 10:15:52 +0200" Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: 24 Sep 1999 14:06:44 +0200 Message-ID: X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: weis > class dtree = > object > inherit [#debug] ctree > end > > But the compiler gives me the error: > > Some type variables are unbound in this type: > class dtree : > object val mutable content : (#debug as 'a) tree method get : 'a > tree end > The method get has type #debug tree where .. is unbound > make: *** [test.cmo] Error 2 > Here is a simple solution: just write your class as: class ['a] dtree = object constraint 'a = #debug inherit ['a] ctree end Indeed, no type variable can stay unbounded (hence the ['a]) in a class definition. #debug (equivalent to < debug : unit; .. >) is an abbreviation that hides a type variable (the elipsis: ..). -- Pierre.