From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6QMkJA5008534 for ; Wed, 27 Jul 2011 00:46:19 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtQCAOVCL07RVdIyimdsb2JhbAA1AQEBAQMUAhcTCAE8AQMNAQYFQBIUJgEFASQHPpthi0EIFAEBAQoJDQcSBiGtVgqOeoR4iScCAwaFW18Eh1WLHYYtgz2CXjyBP4Is X-IronPort-AV: E=Sophos;i="4.67,272,1309730400"; d="scan'208";a="103953534" Received: from mail-pz0-f50.google.com ([209.85.210.50]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 27 Jul 2011 00:46:13 +0200 Received: by pzk2 with SMTP id 2so1670562pzk.37 for ; Tue, 26 Jul 2011 15:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=f5sZW4ev6E2jkGbLvHuzR+700q1d8jXorPSxPGUYIzI=; b=g/2X55Nf6m2H8sJiL3KF7li+SN4DFcvsZU4XJxn64n0gO39OPjOWdYLMV4HL3UX73i WFlPr/hk2Auqj7Gt/XkOnuemIFogv02Q9MsdzgeoK5y+0uS2UQfJv+VyduomzsK6saNo RJ0XF0qzCBUABdcwJfzG9OVNMaLuv2R+ZeXCg= Received: by 10.68.62.197 with SMTP id a5mr10976752pbs.494.1311720371406; Tue, 26 Jul 2011 15:46:11 -0700 (PDT) Received: from tanpopo.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mx.google.com with ESMTPS id e6sm994152pbm.71.2011.07.26.15.46.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jul 2011 15:46:09 -0700 (PDT) Sender: Jacques Garrigue Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: Date: Wed, 27 Jul 2011 07:46:09 +0900 Cc: caml-list Message-Id: <955FD80F-3BD7-41C3-917F-A3FC024CD0DD@math.nagoya-u.ac.jp> References: To: Polux Moon X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p6QMkJA5008534 Subject: Re: [Caml-list] Problem with forall and method This is a bug. Please report to http://caml.inria.fr/mantis Jacques Garrigue On 2011/07/26, at 21:17, Polux Moon wrote: > (Sorry for duplicate mail, I forgot to change the subject in the first one) > > Hi, > > I have a type error on code similar to : > > ----- > type 'par t = 'par > > let ident v = v > > class alias = > object > method alias : 'a . 'a t -> 'a = ident (* type error here *) > end > ----- > > Which gives : > > ----- > Error: This expression has type 'a. 'a t -> 'a > but an expression was expected of type 'b. 'b t -> 'b > Type 'a a = 'a is not compatible with type 'b t = 'b > ----- > > The problem is related to unification of foralls containing named type in a method. > The compiler accepts equivalent code when not using the named type "t" or when not using a method (see attached file). > > Is it a [known] limitation ? Is there a way to work around it ? > >