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 VAA28054 for caml-red; Wed, 11 Oct 2000 21:49:46 +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 EAA18469 for ; Wed, 11 Oct 2000 04:37:10 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e9B2b8H16181 for ; Wed, 11 Oct 2000 04:37:09 +0200 (MET DST) Received: from localhost (sansho.kurims.kyoto-u.ac.jp [130.54.16.90]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id LAA00250; Wed, 11 Oct 2000 11:36:58 +0900 (JST) To: malc@pulsesoft.com Cc: caml-list@inria.fr Subject: Re: Polymorphic variants in class methods In-Reply-To: Your message of "Mon, 9 Oct 2000 02:18:06 +0400 (MSD)" References: X-Mailer: Mew version 1.93 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001011113553Y.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 11 Oct 2000 11:35:53 +0900 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Sender: weis@pauillac.inria.fr From: malc > # class foo = object method moo = `Bar end;; > Some type variables are unbound in this type: > class foo : object method moo : [> `Bar] end > The method moo has type [> `Bar] where 'a is unbound You can see it as a bug in the error message printer: the real message should be The method moo has type ([> `Bar] as 'a) where 'a is unbound That is, the type [> `Bar] is not fully specified (it contains a row variable), and as a result you cannot use it in a method type, which must be fully specified. Easy solution, add a type annotation: # class foo = object method moo : [`Bar] = `Bar end;; class foo : object method moo : [ `Bar] end Jacques --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG