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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE 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 A58D7BC69 for ; Wed, 2 May 2007 02:26:21 +0200 (CEST) Received: from rabbit.math.nagoya-u.ac.jp (rabbit.math.nagoya-u.ac.jp [133.6.130.5]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l420QJZD000686 for ; Wed, 2 May 2007 02:26:20 +0200 Received: from localhost (rabbit-172 [172.16.254.254]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id l420Q9a4013341; Wed, 2 May 2007 09:26:10 +0900 (JST) Date: Wed, 02 May 2007 09:25:38 +0900 (JST) Message-Id: <20070502.092538.74749440.garrigue@math.nagoya-u.ac.jp> To: tf@functionality.de Cc: caml-list@inria.fr Subject: Re: [Caml-list] Is this a bug? From: Jacques Garrigue In-Reply-To: <4637399F.6010103@functionality.de> References: <4637399F.6010103@functionality.de> X-Mailer: Mew version 5.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4637DAAB.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 bool:01 failwith:01 foo:01 val:01 bug:01 type-checker:01 constructor:01 clearer:01 caml-list:01 int:01 purely:02 string:02 string:02 garrigue:03 From: Thomas Fischbacher > If we look at the following piece of code: > > ===> > type dof_region_spec = (string * bool * (int option array)) array;; > type opt_field_restriction = dof_region_spec option;; > > let make_field ?(name="Field") ?restriction ?constant_value mwe = > let restriction:opt_field_restriction = restriction in > failwith "FOO";; > <=== > > ...then make_field types as: > > ===> > val make_field : > ?name:string -> ?restriction: -> ?constant_value:'a -> 'b -> 'c > <=== > > The actually should not show up here. What is going on? You could call it a printer "bug", but it's probably not worth fixing. The problem is that opt_field_restriction hides the "option" type constructor. To recover it one would have to expand it, but the printer is not supposed to do type expansion (it must show the types as they are). So I would be tempted to say that a reasonable fix would be to replace by