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 NAA19135; Tue, 12 Mar 2002 13:47:38 +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 NAA06536 for ; Tue, 12 Mar 2002 13:47:37 +0100 (MET) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g2CClaT26343 for ; Tue, 12 Mar 2002 13:47:36 +0100 (MET) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto4.wanadoo.fr; 12 Mar 2002 13:47:36 +0100 Received: from debian (80.8.74.155) by mel-rta7.wanadoo.fr; 12 Mar 2002 13:47:14 +0100 Received: from moi by debian with local (Exim 3.35 #1 (Debian)) id 16klgV-0001MG-00 for ; Tue, 12 Mar 2002 13:47:19 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Constraint References: <000701c1c9be$22947b50$e700a8c0@warp> From: Remi VANICAT Date: 12 Mar 2002 13:47:19 +0100 In-Reply-To: <000701c1c9be$22947b50$e700a8c0@warp> Message-ID: <87eliq0x7s.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Warp" writes: > Hi > I had a quite big parametrized class and it takes me few hours to figure out > where a constraint I didn't want was occuring. It's true that I'm not very > familiar with constraints, but I think it would be nice to enable the OCaml > compiler to print some more informations about where the constraint occurs > in the code ( a simple line number will be enough. ) I don't know if that > can be done, but i think that would be somehow useful. There is a possibility to find such error. Here an example : class type foo = object method baz : int end class ['a] bar (f : 'a) = object method buz = (f #baaz) + 1 end here, I've done a mistake in the name of the method baz (writing it baaz). I can temporally transform my code in : class ['a] bar (f : 'a) = object constraint 'a = foo method buz = (f #baaz) + 1 end then, I will have a type error (no method baaz). of course it's not a clean method, but it work. -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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