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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B7EFBBC77 for ; Tue, 1 May 2007 15:34:31 +0200 (CEST) Received: from chokecherry.srv.cs.cmu.edu (CHOKECHERRY.SRV.CS.CMU.EDU [128.2.185.41]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l41DYTgH020619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 1 May 2007 15:34:31 +0200 Received: from stratocaster.home (pool-70-17-172-171.pitt.east.verizon.net [70.17.172.171]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id l41DYSUE003662 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 1 May 2007 09:34:28 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.63) (envelope-from ) id 1HisUk-0007Hu-3K for caml-list@inria.fr; Tue, 01 May 2007 09:34:18 -0400 Date: Tue, 1 May 2007 09:34:18 -0400 To: caml-list@inria.fr Subject: Re: [Caml-list] Is this a bug? Message-ID: <20070501133418.GA27683@stratocaster.home> Mail-Followup-To: caml-list@inria.fr References: <4637399F.6010103@functionality.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4637399F.6010103@functionality.de> User-Agent: Mutt/1.5.13 (2006-08-11) From: Eric Cooper X-Miltered: at concorde with ID 463741E5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 bug:01 foo:01 val:01 foo:01 val:01 ocamlc:01 caml-list:01 int:01 int:01 expression:02 string:02 seems:03 seems:03 unit:03 It certainly seems to be a bug. Here's a smaller example: type intopt = int option let foo ?flag () = let (_ : intopt) = flag in () prints as val foo : ?flag: -> unit -> unit = It still seems to be typed correctly: # foo ~flag:17 ();; - : unit = () # foo ~flag:"x" ();; This expression has type string but is here used with type int # let bar ?(flag=0) () = ();; val bar : ?flag:int -> unit -> unit = # [foo; bar];; - : (?flag: -> unit -> unit) list = [; ] The bug is also present when you run "ocamlc -i ..." -- Eric Cooper e c c @ c m u . e d u