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 SAA17213; Thu, 29 Aug 2002 18:03:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 SAA17264 for ; Thu, 29 Aug 2002 18:03:41 +0200 (MET DST) Received: from smtp.noos.fr (claudel.noos.net [212.198.2.83]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7TG3eD13011 for ; Thu, 29 Aug 2002 18:03:40 +0200 (MET DST) Received: (qmail 50894435 invoked by uid 0); 29 Aug 2002 16:03:38 -0000 Received: from unknown (HELO noos.fr) ([81.65.61.57]) (envelope-sender ) by 212.198.2.83 (qmail-ldap-1.03) with SMTP for ; 29 Aug 2002 16:03:38 -0000 Message-ID: <3D6E45DA.51D99F9F@noos.fr> Date: Thu, 29 Aug 2002 18:03:38 +0200 From: nadji@noos.fr X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.18 i686) X-Accept-Language: en MIME-Version: 1.0 To: "caml-list@inria.fr" Subject: [Caml-list] polymorphic variant question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all, I am puzzled by the code below which doesn't work. # let f = function `B -> ();; val f : [ `B] -> unit = # let g x = match (x:[`A|`B]) with `A -> () | y -> f y;; Characters 51-52: let g x = match (x:[`A|`B]) with `A -> () | y -> f y;; ^ This expression has type [ `A | `B] but is here used with type [ `B] (denoting the "y" from the "f y") How can I say to OCaml that "y" can't be of type `A ? TIA, Nadji ------------------- 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