From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 98DEABC29 for ; Fri, 4 Aug 2006 16:18:43 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k74EIhks018353 for ; Fri, 4 Aug 2006 16:18:43 +0200 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 QAA18136 for ; Fri, 4 Aug 2006 16:18:42 +0200 (MET DST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k74EIflE029894 for ; Fri, 4 Aug 2006 16:18:42 +0200 Received: by py-out-1112.google.com with SMTP id f25so277346pyf for ; Fri, 04 Aug 2006 07:18:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=U+TIUFK+jEAjK14glripg9ivUve050FeGtGR+zeEt0sxkanfoCqafP2yNKappECnoTrY4/7C1rJwqX2RqiG+r+ISMgO97SVNV4ZWd55oumaQaqnuqIeHAVJubZGh0iBfgMfmAII00EgYJUFdFD8Ml1uDKMz50tRKimx1NmMeFMA= Received: by 10.35.61.2 with SMTP id o2mr5078815pyk; Fri, 04 Aug 2006 07:18:41 -0700 (PDT) Received: by 10.35.20.2 with HTTP; Fri, 4 Aug 2006 07:18:41 -0700 (PDT) Message-ID: <875c7e070608040718p471beb84md8c46d4f7622a8f3@mail.gmail.com> Date: Fri, 4 Aug 2006 10:18:41 -0400 From: "Chris King" To: "Jacques Garrigue" Subject: Re: [Caml-list] Unexpected '_a problem Cc: caml-list@inria.fr In-Reply-To: <20060804.114239.193683263.garrigue@math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6b8a91420608011509s696233cew8d499f315aa0cba9@mail.gmail.com> <44D04D83.5020503@inria.fr> <875c7e070608021057rfb89914x1d6b9c6e7e4d7ce0@mail.gmail.com> <20060804.114239.193683263.garrigue@math.nagoya-u.ac.jp> X-j-chkmail-Score: MSGID : 44D35741.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 44D35743.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44D35741.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 annotation:01 module's:01 wrote:01 abstract:01 caml-list:01 monomorphic:01 output:02 output:02 garrigue:03 garrigue:03 unexpected:03 types:03 unit:03 unit:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 On 8/3/06, Jacques Garrigue wrote: > type 'a bar_t = Bar of unit) -> unit> ;; > let create_bar () = Bar (object method bar (_: 'a) = () end);; > let b = create_bar ();; > let Bar b = b;; Okay, that got the types to work out correctly. > If you still want to use Obj.magic, remember to put complete type > annotions on both its input and output, as the lack of type > information may break the compiler. Surprisingly putting a type annotation on its output caused it to infer a monomorphic type - I was relying on the type in the module's signature since the type there is abstract.