From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 8E984BB84 for ; Wed, 28 Jan 2009 15:10:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAEP2f0lPrU4G/2dsb2JhbACMbr8uhUcG X-IronPort-AV: E=Sophos;i="4.37,338,1231110000"; d="scan'208";a="23197165" Received: from oak.tepkom.ru ([79.173.78.6]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 28 Jan 2009 15:10:31 +0100 Received: from localhost (localhost [127.0.0.1]) by oak.tepkom.ru (Postfix) with ESMTP id 1E1013119B8; Wed, 28 Jan 2009 17:10:30 +0300 (MSK) X-Virus-Scanned: amavisd-new 2.6.1 (20080629) at tepkom.ru Received: from oak.tepkom.ru ([127.0.0.1]) by localhost (oak.tepkom.ru [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28spbrhbxd0h; Wed, 28 Jan 2009 17:10:29 +0300 (MSK) Received: from [192.168.1.4] (ppp78-37-146-68.pppoe.avangarddsl.ru [78.37.146.68]) (Authenticated sender: db) by oak.tepkom.ru (Postfix) with ESMTP id F0ADF31191E; Wed, 28 Jan 2009 17:10:28 +0300 (MSK) Message-ID: <49806746.9030507@tepkom.ru> Date: Wed, 28 Jan 2009 17:10:14 +0300 From: Dmitri Boulytchev User-Agent: Thunderbird 2.0.0.17 (X11/20080929) MIME-Version: 1.0 To: Julien SIGNOLES Cc: caml-list Subject: Re: [Caml-list] Warning wished References: <1233150828.7199.213.camel@localhost> In-Reply-To: <1233150828.7199.213.camel@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; compiler:01 bug:01 signoles:01 beginner's:01 ocaml:01 bug:01 polymorphic:01 beginners:01 emit:01 dmitry:01 caml-list:01 caml-list:01 bin:01 caml:02 caml:02 Hello Julien, no warning should be issued in this case since you have polymorphic function: applying g to () you will definitely have f x of type unit :) Try another one: let f x = x+1 let g x = f x; 1 Now you'll get the warning since the compiler can ensure that type of f x can never be unit. Best regards, Dmitry. > Hello, > > Is it a bug or a well-known feature that the above program does not emit > a warning (because "f x" should have type unit in the body of "g") ? > > ===== > let f x = x > let g x = f x; 1 > (* let _ = g 2 *) > ==== > > Best regards, > Julien Signoles > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >