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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6CBE8BBC4 for ; Fri, 6 Mar 2009 16:57:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoEDACPWsEmMTaZEgWdsb2JhbACBTpM6AQEWIsF1hAgG X-IronPort-AV: E=Sophos;i="4.38,315,1233529200"; d="scan'208";a="22163526" Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) ([140.77.166.68]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 06 Mar 2009 16:57:45 +0100 Received: from localhost (localhost [127.0.0.1]) by toccata.ens-lyon.org (Postfix) with ESMTP id 067FE84074 for ; Fri, 6 Mar 2009 16:57:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at toccata.ens-lyon.org Received: from toccata.ens-lyon.org ([127.0.0.1]) by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DVeZmR4ZSfEy for ; Fri, 6 Mar 2009 16:57:44 +0100 (CET) Received: from [192.168.1.2] (39.4.103-84.rev.gaoland.net [84.103.4.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by toccata.ens-lyon.org (Postfix) with ESMTP id B15A584061 for ; Fri, 6 Mar 2009 16:57:44 +0100 (CET) Message-ID: <49B147F7.4090303@ens-lyon.org> Date: Fri, 06 Mar 2009 16:57:43 +0100 From: Samuel Mimram User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Objects and variants X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ens-lyon:01 variants:01 parametrize:01 cheers:01 unbound:01 unbound:01 compile:01 constraint:01 inferred:02 variables:02 binding:02 objects:02 seems:03 unit:03 unit:03 Hi, When I try to compile the following code: class a = object method f (x:[>]) = () end I get the following error: Error: Some type variables are unbound in this type: class a : object method f : [> ] -> unit end The method f has type ([> ] as 'a) -> unit where 'a is unbound Is the binding of [>] to 'a really necessary here? In particular it is not mentioned in the inferred type... Of course I can parametrize the class over 'a as class ['a] a = object method f (x:[>] as 'a) = () end which now has type class ['a] a : object constraint 'a = [> ] method f : 'a -> unit end But this seems rather cumbersome. Is there a way to handle this without mentioning 'a? Thanks! Cheers, Samuel.