From: Pierre Boulet <Pierre.Boulet@lifl.fr>
To: peter.schrammel@gmx.de
Cc: caml-list@inria.fr
Subject: Re: Tree of a certain class:
Date: 24 Sep 1999 14:06:44 +0200 [thread overview]
Message-ID: <vtuln9wa4yz.fsf@gala.lifl.fr> (raw)
In-Reply-To: Peter Schrammel's message of "Fri, 24 Sep 1999 10:15:52 +0200"
> class dtree =
> object
> inherit [#debug] ctree
> end
>
> But the compiler gives me the error:
>
> Some type variables are unbound in this type:
> class dtree :
> object val mutable content : (#debug as 'a) tree method get : 'a
> tree end
> The method get has type #debug tree where .. is unbound
> make: *** [test.cmo] Error 2
>
Here is a simple solution: just write your class as:
class ['a] dtree =
object
constraint 'a = #debug
inherit ['a] ctree
end
Indeed, no type variable can stay unbounded (hence the ['a]) in a
class definition. #debug (equivalent to < debug : unit; .. >) is an
abbreviation that hides a type variable (the elipsis: ..).
--
Pierre.
next prev parent reply other threads:[~1999-09-24 16:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-17 1:13 What am I missing? skaller
1999-09-17 12:44 ` Pierre Weis
1999-09-24 8:15 ` Tree of a certain class: Peter Schrammel
1999-09-24 12:06 ` Pierre Boulet [this message]
1999-09-24 12:18 ` Sylvain BOULM'E
1999-09-24 12:35 ` Jerome Vouillon
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=vtuln9wa4yz.fsf@gala.lifl.fr \
--to=pierre.boulet@lifl.fr \
--cc=caml-list@inria.fr \
--cc=peter.schrammel@gmx.de \
/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