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 WAA19916 for caml-red; Sun, 21 Jan 2001 22:31:32 +0100 (MET) 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 WAA21559 for ; Sun, 21 Jan 2001 22:31:17 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f0LLVGv28402; Sun, 21 Jan 2001 22:31:16 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA21703; Sun, 21 Jan 2001 22:31:16 +0100 (MET) From: Pierre Weis Message-Id: <200101212131.WAA21703@pauillac.inria.fr> Subject: Re: Implicit constraints in type declaration In-Reply-To: from Alain Frisch at "Jan 21, 101 05:59:06 pm" To: frisch@clipper.ens.fr (Alain Frisch) Date: Sun, 21 Jan 2001 22:31:16 +0100 (MET) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr > Hello, > > I don't understand why the following type declaration implies a > constraint: > > # type 'a t = int and b = int t;; > type 'a t = int constraint 'a = int > type b = int t > > Also, I don't understand this error message (I can imagine why > the declaration is illegal): > > # type 'a t = u and u = int;; > ^^^^^^^ > A type variable is unbound in this type declaration > > > -- > Alain Frisch All those glitches were due to a strange way of type cheking type definitions using unification. Jacques (Garrigue) reimplemented the old semantics for ordinary type definitions. Thus, your examples now work fine in the working version of the compiler: Objective Caml version 3.00+20 (2000-12-03) # type 'a t = int and b = int t;; type 'a t = int type b = int t # type 'a t = u and u = int;; type 'a t = u type u = int Best regards, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/