From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: malc@pulsesoft.com
Cc: caml-list@inria.fr
Subject: Re: Polymorphic variants in class methods
Date: Wed, 11 Oct 2000 11:35:53 +0900 [thread overview]
Message-ID: <20001011113553Y.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: Your message of "Mon, 9 Oct 2000 02:18:06 +0400 (MSD)" <Pine.LNX.4.21.0010090217030.885-100000@home.oyster.ru>
From: malc <malc@pulsesoft.com>
> # class foo = object method moo = `Bar end;;
> Some type variables are unbound in this type:
> class foo : object method moo : [> `Bar] end
> The method moo has type [> `Bar] where 'a is unbound
You can see it as a bug in the error message printer: the real message
should be
The method moo has type ([> `Bar] as 'a) where 'a is unbound
That is, the type [> `Bar] is not fully specified (it contains a row
variable), and as a result you cannot use it in a method type, which
must be fully specified.
Easy solution, add a type annotation:
# class foo = object method moo : [`Bar] = `Bar end;;
class foo : object method moo : [ `Bar] end
Jacques
---------------------------------------------------------------------------
Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
next prev parent reply other threads:[~2000-10-11 19:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-08 22:18 malc
2000-10-11 2:35 ` Jacques Garrigue [this message]
2000-10-11 18:54 ` Brian Rogoff
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=20001011113553Y.garrigue@kurims.kyoto-u.ac.jp \
--to=garrigue@kurims.kyoto-u.ac.jp \
--cc=caml-list@inria.fr \
--cc=malc@pulsesoft.com \
/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