caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: wester@ilt.fhg.de
To: caml-list@inria.fr
Subject: [Caml-list] classes and labels
Date: Tue, 20 Mar 2001 16:02:24 +0100	[thread overview]
Message-ID: <200103201502.QAA27766@ilt.fhg.de> (raw)

Hi,

I have the class definition:

# class myclass ?(n=0) () =
  object  
   val nn = n;
   method get_nn = nn
   method clone (na: int) = let (mc: myclass) = new myclass ~n:na () in mc;
end;;
 
that produces the following error message in the toplevel:

          Characters 5-153:
The expression "new myclass" has type ?n:int -> unit -> myclass
but is used with type int -> unit -> myclass

Can sombody tell what is wrong with my class definition?
I would be very apprecitative for any help.

With kind regards

Rolf Wester
-------------------------------------
Rolf Wester
wester@ilt.fhg.de
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-03-20 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-20 15:02 wester [this message]
2001-03-20 22:11 ` Gerd Stolpmann
2001-03-21  0:06 ` Jacques Garrigue

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=200103201502.QAA27766@ilt.fhg.de \
    --to=wester@ilt.fhg.de \
    --cc=caml-list@inria.fr \
    /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).