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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id D43CDBBAF for ; Thu, 26 Jun 2008 04:47:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHugYkiCNhAB/2dsb2JhbACyaw X-IronPort-AV: E=Sophos;i="4.27,706,1204498800"; d="scan'208";a="14530035" Received: from kurims.kurims.kyoto-u.ac.jp ([130.54.16.1]) by mail3-smtp-sop.national.inria.fr with ESMTP; 26 Jun 2008 04:47:18 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.8/8.13.8) with ESMTP id m5Q2lCPZ022424; Thu, 26 Jun 2008 11:47:13 +0900 (JST) Date: Thu, 26 Jun 2008 11:46:59 +0900 (JST) Message-Id: <20080626.114659.43023347.garrigue@math.nagoya-u.ac.jp> To: khooyp@cs.umd.edu Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Problem with class method and polymorphic variants From: Jacques Garrigue In-Reply-To: References: <9CA92F89-880D-46A8-835C-F4E93722BEE2@cs.umd.edu> <20080625.121226.240480867.garrigue@math.nagoya-u.ac.jp> X-Mailer: Mew version 4.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; variants:01 node:01 node:01 typecore:01 bug:01 polymorphic:01 compile:01 compiles:01 caml-list:01 inherit:01 data:02 data:02 underscore:02 underscore:02 checking:02 From: Khoo Yit Phang > Thanks for the quick response! I've encountered another strange one > that may be related. The code below compiles only if you remove the > underscore in the method "_a". The error message is similar to the > earlier one, but I think it's a different problem? > > class ['a] node d = > object > method _d : 'a = d > method p (x : 'a) = "" > end > > class ['a] pnode data = > object (self) > inherit ['a] node data > (* doesn't compile with the underscore in "_a" *) > method _a = self > method p = function `P p -> p#name > end The problem seems the same as the previous one, and it goes away with the latest release310 version of typecore.ml. As to why the name of the method matters, it may be related to the order in which the checking is done. Since types are graphs, this ends up being relevant (but only when there is a bug!) Jacques Garrigue