caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <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
Date: Thu, 26 Jun 2008 11:46:59 +0900 (JST)	[thread overview]
Message-ID: <20080626.114659.43023347.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <F3ADA092-F3DE-445F-8029-295160387CE6@cs.umd.edu>

From: Khoo Yit Phang <khooyp@cs.umd.edu>

> 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) = "<data>"
>      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


      reply	other threads:[~2008-06-26  2:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24 18:17 Khoo Yit Phang
2008-06-25  3:12 ` [Caml-list] " Jacques Garrigue
2008-06-25  5:17   ` Khoo Yit Phang
2008-06-26  2:46     ` Jacques Garrigue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080626.114659.43023347.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=khooyp@cs.umd.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).