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 JAA26272; Wed, 19 Feb 2003 09:44:23 +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 JAA26325 for ; Wed, 19 Feb 2003 09:44:22 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h1J8iKT29982 for ; Wed, 19 Feb 2003 09:44:21 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id RAA20508; Wed, 19 Feb 2003 17:44:13 +0900 (JST) To: alex@baretta.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Baffling typing problem In-Reply-To: <3E533CAD.8080400@baretta.com> References: <3E533CAD.8080400@baretta.com> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030219174413Y.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 19 Feb 2003 17:44:13 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Alessandro Baretta [..] > I attempt to compile it with ocamlc I get this error message: > File "prova.ml", line 1, characters 16-169: > Warning: this pattern-matching is not exhaustive. > Here is an example of a value that is not matched: > "" > File "prova.ml", line 6, characters 11-27: > The type of this expression, > _[> `BANG of _[> `Foo] * '_a list * '_b list > | `WHIZ of _[> `Bar] * _[> `Frob | `Twid] list > | `WHOA of _[> `Foo] * _[> `Frob | `Knob | `Twid] list], > contains type variables that cannot be generalized This is not really related to polymorphic variants, only to the fact they are polymorphic. Due to the value-only restriction, you have an expression that cannot be generalized. Since it contains some type variables, the compiler cannot produce a .cmi from it. > Is there any way around this limitation? Write a .mli, or just explicitly put a type annotation on that expression. Seeing the shape of your type, it may be the case that the CVS version of ocaml could generalize it (actually this is sound). This should avoid some of such problems. Jacques Garrigue ------------------- 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